Modernizing Applications with Microservices and DC/OS (Lightbend/Mesosphere co-webinar)

7,452 views

Published on

**Featuring Aaron Williams, Head of Advocacy at Mesosphere, Inc. and Markus Eisele, Developer Advocate at Lightbend, Inc.**

The traditional architecture that enterprises run their businesses on has typically been delivered as monolithic applications running in a virtualized, on-premise infrastructure. Public and private cloud technologies have changed everything, but if the applications are not designed, or re-designed, appropriately, then it is impossible to take advantage of the advances in both distributed application services and hybrid infrastructure. Consequently, enterprise architects are looking to microservices-based architectures as a means to modernize their legacy applications.

This webinar with Lightbend and partner Mesosphere will introduce a new framework specifically designed to help developers modernize legacy Java EE applications into systems of microservices and then discuss exactly what is required to run these distributed systems at enterprise scale.

Published in: Software

Modernizing Applications with Microservices and DC/OS (Lightbend/Mesosphere co-webinar)

  1. 1. WEBINAR Modernizing Applications with 
 Microservices and DC/OS Markus Eisele (@myfear), Lightbend Aaron Williams (@_arw_), Mesosphere
  2. 2. Classical Architectures?
  3. 3. LL: Building and Scaling Monoliths • Monolithic application – everything is package into a single .ear • Reuse primarily by sharing .jars • A “big” push to production once or twice a year • Single database schema for the entire application • >= 500k loc • >= Heavyweight Infrastructure • Thousands of Testcases • Barely New Testcases • >= 20 Team Member • The single .ear requiring a multi-month test cycle / • Huge bug and feature databases • User Acceptance Undefined • Technical Design Approach • Barely Business Components or Domains • Requiring multiple team involvement & significant oversight • Technical Dept • Outdated Runtimes (Licenses, Complex updates) • Grown applications
  4. 4. More users http://www.internetlivestats.com/internet-users/ J2EE Spring RoR Akka Reactive Manifesto Microservices
  5. 5. New requirements • Rather than acting on data at rest, modern software increasingly operates on data in near real-time.  • Shortened time-frames for putting changes into production • New business models evolve from existing ones • New questions need to be answered by existing applications • Datacenter costs need to go down constantly
  6. 6. Modernization!
  7. 7. Routing Module Tracking Module Order Module Tracker UIBrowser HistoryDB Order DB RoutesDB Tracker UI Tracker UI Browser Browser
  8. 8. REQ: Building and Scaling Microservices • Lightweight runtime • Cross – Service Security • Transaction Management • Service Scaling • Load Balancing • SLA’s • Flexible Deployment • Configuration • Service Discovery • Service Versions • Monitoring • Governance • Asynchronous communication • Non-blocking I/O • Streaming Data • Polyglot Services • Modularity (Service definition) • High performance persistence (CQRS) • Event handling / messaging (ES) • Eventual consistency • API Management • Health check and recovery
  9. 9. “Microservices” is a lousy term • Size is irrelevant We want flexible systems and organizations that can adapt to their complex environments, make changes without rigid dependencies and coordination, can learn, experiment, and exhibit emergent behavior.
  10. 10. We need to build systems for flexibility and resiliency, not just efficiency and robustness.
  11. 11. Software Design Outer Architecture Methodology and Organization Distributed Systems Datacenter Operating System
  12. 12. Software Design Architecture Principles • Single Responsible Principle • Service Oriented Architecture – Encapsulation – Separation of Concern – Loose Coupling • Hexagonal Architecture Design Patterns • Domain-driven Design • Bounded Contexts • Event Sourcing • CQRS • Eventual Consistency • Context Maps
  13. 13. Design Best Practices • Design for Automation • Designed for failure • Service load balancing and automatic scaling • Design for Data Separation • Design for Integrity • Design for Performance
  14. 14. Strategies For Decomposing Verb or Use Case e.g. Checkout UI Noun e.g. Catalog product service Single Responsible Principle e.g. Unix utilities
  15. 15. • Reactive Microservices Framework for the JVM • Focused on right sized services • Asynchronous I/O and communication as first class priorities • Highly productive development environment • Takes you all the way to production What is Lagom?
  16. 16. • Service API • Persistence API • Development environment • Production environment Highly opinionated
  17. 17. • Event sourced (deltas) with Cassandra backend by default • No object/relational impedance mismatch • Can always replay to determine current state • Allows you to learn more from your data later • Persistent entity is an Aggregate Root in DDD • Can be overridden for CRUD if you want Lagom Persistence API
  18. 18. The little example!
  19. 19. Cargo Tracker https://github.com/lagom/activator-lagom-cargotracker
  20. 20. Registration Shipping Frontend Cassandra
  21. 21. >sbt bundle:dist ... [info] Your package is ready in /Users/myfear/lagom-cargotracker/front- end/target/universal/front-end-1.0- SNAPSHOT.zip Create Service bundles
  22. 22. Now that we have our bundles, how do we get into production?
  23. 23. © 2015 Mesosphere, Inc. All Rights Reserved. 28 Datacenter Operating System (DC/OS) ENTERPRISE MICROSERVICES
  24. 24. © 2015 Mesosphere, Inc. All Rights Reserved. TOWARDS MICROSERVICES ARCHITECTURE Traditional Architecture Microservices Architecture Small number of large processes with strong inter-dependencies Cross-functional teams creating new microservices without interdependencies RESTAPIs Scales monolithically Many functions in a single process Cross-functional teams organized around capabilities Scales individually Siloed teams Each element of functionality defined as “microservices”
  25. 25. © 2015 Mesosphere, Inc. All Rights Reserved. 30 THE DATACENTER IS THE NEW SERVER PHYSICAL (x86) VIRTUAL HYPERSCALEMAINFRAME SERVER VIRTUAL MACHINEPARTITION (LPAR) UNIT OF INTERACTION ● ERP, CRM, PRODUCTIVITY, MAIL & WEB SERVER ● LINUX, WINDOWS ● DATA / TRANSACTION PROCESSING ● UNIX, IBM OS/360 DEFINITIVE APPS AND OS ● ERP, CRM, PRODUCTIVITY, MAIL & WEB SERVER ● HYPERVISOR + GUEST OS ● BIG DATA, INTERNET OF THINGS, MOBILE APPS ● ??? ???DATACENTER NEW FORM FACTOR FOR DEVELOPING AND RUNNING APPS ● BIG DATA, INTERNET OF THINGS, MOBILE APPS ● DATACENTER OPERATING SYSTEM (DCOS)
  26. 26. © 2015 Mesosphere, Inc. All Rights Reserved. Datacenter Operating System (DCOS) Distributed Systems Kernel (Apache Mesos) DC/OS ACCELERATES ENTERPRISES TO A MODERN CLOUD STACK WITH THE DATACENTER FORM FACTOR Big Data + Analytics EnginesMicroservices (in containers) Streaming Batch Machine Learning Analytics Functions & Logic Search Time Series SQL / NoSQL Databases Modern Cloud App Components Distributed systems kernel to abstract resources Killer “apps” ecosystem Cont Integration/Cont Delivery Framework “app” architecture to consistently run on top of kernel User Interface (GUI & CLI) Core system services (e.g., distributed init, cron, service discovery, package mgt & installer, storage) Any Infrastructure (Physical, Virtual, Cloud)
  27. 27. DC/OS FEATURE PRODUCTION PROVEN TECHNOLOGY AT SCALE DC/OS ARCHITECTURE BENEFITS © 2016 Mesosphere, Inc. Proprietary & Confidential ● DC/OS is built on the production-proven Apache Mesos and Marathon ● Built and refined with best practices by some of the world's top experts in distributed systems ● Tested to 10s of thousands of nodes in production for more than 6+ years in production ● Designed for resiliency and scale from day 1 ● Reliable, mature technology with years of bug fixing, reduce risk of downtime for mission critical workloads ● Easily expand from small to very large clusters with confidence ● Open source core prevents vendor lock-in
  28. 28. DC/OS FEATURE MODERN DISTRIBUTED HIGH AVAILABILITY DC/OS ARCHITECTURE BENEFITS © 2016 Mesosphere, Inc. Proprietary & Confidential ● No SPOF, N+1 Architecture ● Integrated KV Store, DB & load balancing for seamless failover and maintenance ● Turn-key solution, no external dependencies for HA ● Agent crash, restart & upgrade does not affect workloads ● Erlang based distributed networking stack for on the fly upgrade ● Non disruptive failover and upgrade for masters and agents ● Highest uptime for scalable masters, agents and workloads ● No manual intervention in case of master/agent failover ● Easily move to the latest DC/OS release ● Resilience to network partitioning & split brain scenarios
  29. 29. DC/OS FEATURE CONTAINERS AND DATA SERVICES WORKLOAD SUPPORT ON DC/OS BENEFITS © 2016 Mesosphere, Inc. Proprietary & Confidential Supports Stateless and Stateful Containers ● Docker Containers ● Mesos Containers (i.e Java Binaries, Go Binaries) Supports Stateful Data and Analytics Services ● Analytics & Big Data (i.e Spark, HDFS), No-SQL Databases (i.e Cassandra) ● Search (i.e Elasticsearch), Message Queueing (i.e Kafka) Linux and (soon) Windows ● Increased Utilization across datacenter ● Easily scale applications up and down ● Single platform for all applications, simplifying operations ● Easily experiment & deploy with new datacenter services easily with our app Universe
  30. 30. DC/OS FEATURE SERVICE DISCOVERY DC/OS Networking BENEFITS © 2016 Mesosphere, Inc. Proprietary & Confidential DC/OS Master DC/OS Svc. Registry (DNS) DC/OS Master DC/OS Svc. Registry (DNS) DC/OS Master DC/OS Svc. Registry (DNS) Corporate/External DNS Server DC/OS Agent Container Container Container DC/OS Agent Container Container Container DC/OS Agent Container Container Container DC/OS Agent Container Container Container Service 1 Service 2 Service 3 External Service ● DNS-based Service Registry & Distr. DNS Proxy ● Integrated DC/OS Service Discovery ● Integrated External Service Discovery ● Highly available & scalable service registry ● Turn-key solution to deploy micro-services ● Integration with existing non-DC/OS services to enable brownfield deployments.
  31. 31. DC/OS FEATURE SERVICE AVAILABILITY WITH L4 DISTRIBUTED LB DC/OS Networking BENEFITS © 2016 Mesosphere, Inc. Proprietary & Confidential DC/OS Agent Container Container Container DC/OS Agent Container Container Container DC/OS Agent Container Container Container DC/OS Agent Container Container Container Service 1 Service 2 Service 3 Service 2 Virtual IP Virtual IP Service 1 Service 3 Virtual IP ● Fast Converging Distributed Load Balancer ● Integrated with DC/OS Service Discovery ● Integrated Blue-Green deployment ● Support for variety of Layer 4 LB algorithms ● Highly available LB with no single choke point ● Enable non-disruptive service upgrades with blue-green deployments. ● Highly scalable and tolerant to large # of host failures.
  32. 32. DC/OS FEATURE STATEFUL CONTAINERS WITH VOLUMES DC/OS Storage BENEFITS © 2016 Mesosphere, Inc. Proprietary & Confidential DC/OS Agent Container Container Container DC/OS Agent Container Container Container DC/OS Agent Container Container Container DC/OS Agent Container Container Container Service 1 Service 2 Service 3 Virtual IP Virtual IP Virtual IP ● Persistent Local Volumes for Containers ● External Volumes using Shared Storage ● DC/OS Volume Management UI ● Run Stateful applications like MySQL in Containers. ● Integrate with existing shared storage ● Manage & Troubleshoot with integrated volume manager
  33. 33. DC/OS FEATURE MODERN GRAPHICAL USER INTERFACE DC/OS POWERFUL MANAGEMENT TOOLS BENEFITS © 2016 Mesosphere, Inc. Proprietary & Confidential Simple UI to deploy and manage ● Containers ● Jobs, scheduled and recurring (formerly Chronos) ● Datacenter services with App universe ● Infrastructure Mgmt, Security and Access Control ● Monitoring & Troubleshooting ● Simplified application portability, cloud bursting, ensuring no vendor lock-in (true hybrid cloud). ● Simplified CI/CD integration, No complex scripts to manage/maintain across environments
  34. 34. DC/OS FEATURE POWERFUL COMMAND LINE INTERFACE (CLI) DC/OS POWERFUL MANAGEMENT TOOLS BENEFITS © 2016 Mesosphere, Inc. Proprietary & Confidential ● Powerful CLI for deploying and managing all workloads including containers, jobs & packages ● Monitor & troubleshoot application and system logs ● Run on Mac, Windows, Linux ● Native ssh encryption ● Integrated access control ● Securely manage your datacenter, anywhere ● Build powerful scripts from administrator machine ● Automate datacenter administration using powerful change managements tool (chef/puppet)
  35. 35. Next Steps! Download and try Lagom! Project Site: http://www.lightbend.com/lagom GitHub Repo: https://github.com/lagom Documentation: http://www.lagomframework.com/documentation/1.0.x/Home.html Example: https://github.com/typesafehub/activator-lagom-java
  36. 36. Written for architects and developers that must quickly gain a fundamental understanding of microservice-based architectures, this free O’Reilly report explores the journey from SOA to microservices, discusses approaches to dismantling your monolith, and reviews the key tenets of a Reactive microservice: • Isolate all the Things • Act Autonomously • Do One Thing, and Do It Well • Own Your State, Exclusively • Embrace Asynchronous Message-Passing • Stay Mobile, but Addressable • Collaborate as Systems to Solve Problems http://bit.ly/ReactiveMicroservice
  37. 37. The detailed example in this report is based on Lagom, a new framework that helps you follow the requirements for building distributed, reactive systems. • Get an overview of the Reactive Programming model and basic requirements for developing reactive microservices  • Learn how to create base services, expose endpoints, and then connect them with a simple, web-based user interface • Understand how to deal with persistence, state, and clients • Use integration technologies to start a successful migration away from legacy systems http://bit.ly/DevelopReactiveMicroservice
  38. 38. https://www.reactivesummit.org/

×