Top Banner
WEBINAR Modernizing Applications with Microservices and DC/OS Markus Eisele (@myfear), Lightbend Aaron Williams (@_arw_), Mesosphere
44

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

Apr 16, 2017

Download

Software

Lightbend
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Modernizing Applications with Microservices and DC/OS (Lightbend/Mesosphere co-webinar)

WEBINAR

Modernizing Applications with Microservices and DC/OS

Markus Eisele (@myfear), Lightbend Aaron Williams (@_arw_), Mesosphere

Page 2: Modernizing Applications with Microservices and DC/OS (Lightbend/Mesosphere co-webinar)
Page 3: Modernizing Applications with Microservices and DC/OS (Lightbend/Mesosphere co-webinar)

Classical Architectures?

Page 4: Modernizing Applications with Microservices and DC/OS (Lightbend/Mesosphere co-webinar)
Page 5: Modernizing Applications with Microservices and DC/OS (Lightbend/Mesosphere co-webinar)
Page 6: Modernizing Applications with Microservices and DC/OS (Lightbend/Mesosphere co-webinar)

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

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

More users

http

://w

ww

.inte

rnet

lives

tats

.com

/inte

rnet

-use

rs/

J2EE

Spring

RoR

Akka

Reactive Manifesto

Microservices

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

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

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

Modernization!

Page 10: Modernizing Applications with Microservices and DC/OS (Lightbend/Mesosphere co-webinar)
Page 11: Modernizing Applications with Microservices and DC/OS (Lightbend/Mesosphere co-webinar)

Routing Module

Tracking Module

Order Module

Tracker UIBrowser HistoryDB

Order DB

RoutesDB

Tracker UI

Tracker UI

Browser

Browser

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

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

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

“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.

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

We need to build systems for flexibility and resiliency, not just efficiency and

robustness.

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

Software DesignOuter Architecture

Methodology and Organization

Distributed Systems

Datacenter Operating System

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

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

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

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

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

Strategies For Decomposing

Verb or Use Casee.g. Checkout UI

Noune.g. Catalog product service

Single Responsible Principle e.g. Unix utilities

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

• 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?

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

• Service API• Persistence API• Development environment• Production environment

Highly opinionated

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

• 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

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

The little example!

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

Cargo Tracker

https://github.com/lagom/activator-lagom-cargotracker

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

Registration

Shipping

Frontend Cassandra

Page 25: Modernizing Applications with Microservices and DC/OS (Lightbend/Mesosphere co-webinar)
Page 26: Modernizing Applications with Microservices and DC/OS (Lightbend/Mesosphere co-webinar)

>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

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

Now that we have our bundles, how do we get

into production?

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

© 2015 Mesosphere, Inc. All Rights Reserved. 28

Datacenter Operating System (DC/OS)

ENTERPRISEMICROSERVICES

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

© 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

REST

API

s

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”

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

© 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)

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

© 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)

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

DC/OS FEATURE

PRODUCTION PROVEN TECHNOLOGY AT SCALEDC/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

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

DC/OS FEATURE

MODERN DISTRIBUTED HIGH AVAILABILITYDC/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

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

DC/OS FEATURE

CONTAINERS AND DATA SERVICESWORKLOAD 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

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

DC/OS FEATURE

SERVICE DISCOVERYDC/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

Cont

aine

r

Cont

aine

r

Cont

aine

r

DC/OS Agent

Cont

aine

r

Cont

aine

r

Cont

aine

r

DC/OS Agent

Cont

aine

r

Cont

aine

r

Cont

aine

r

DC/OS Agent

Cont

aine

r

Cont

aine

r

Cont

aine

rService 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.

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

DC/OS FEATURE

SERVICE AVAILABILITY WITH L4 DISTRIBUTED LBDC/OS Networking

BENEFITS

© 2016 Mesosphere, Inc. Proprietary & Confidential

DC/OS Agent

Cont

aine

r

Cont

aine

r

Cont

aine

r

DC/OS Agent

Cont

aine

r

Cont

aine

r

Cont

aine

r

DC/OS Agent

Cont

aine

r

Cont

aine

r

Cont

aine

r

DC/OS Agent

Cont

aine

r

Cont

aine

r

Cont

aine

rService 1

Service 2

Service 3

Service 2Virtual 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.

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

DC/OS FEATURE

STATEFUL CONTAINERS WITH VOLUMESDC/OS Storage

BENEFITS

© 2016 Mesosphere, Inc. Proprietary & Confidential

DC/OS Agent

Cont

aine

r

Cont

aine

r

Cont

aine

r

DC/OS Agent

Cont

aine

r

Cont

aine

r

Cont

aine

r

DC/OS Agent

Cont

aine

r

Cont

aine

r

Cont

aine

r

DC/OS Agent

Cont

aine

r

Cont

aine

r

Cont

aine

rService 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

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

DC/OS FEATURE

MODERN GRAPHICAL USER INTERFACEDC/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

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

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)

Page 40: Modernizing Applications with Microservices and DC/OS (Lightbend/Mesosphere co-webinar)
Page 41: Modernizing Applications with Microservices and DC/OS (Lightbend/Mesosphere co-webinar)

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

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

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

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

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

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

https://www.reactivesummit.org/