managing microservices in production with lagom

33
Managing Microservices in Production with Lagom by Christopher Hunt (@huntchr)

Upload: lightbend

Post on 09-Jan-2017

2.506 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Managing Microservices in Production with lagom

Managing Microservices in Production with Lagom

by Christopher Hunt (@huntchr)

Page 2: Managing Microservices in Production with lagom

Hybrid Cloud

Page 3: Managing Microservices in Production with lagom

Recap

Page 4: Managing Microservices in Production with lagom

•Reactive Microservices framework for the JVM • Focus on right sized services • Asynchronous IO and communication as first class •Highly productive development environment • Takes you through to production deployment

Lagom for Java Enterprises

Page 5: Managing Microservices in Production with lagom

Today

Page 6: Managing Microservices in Production with lagom

•Deploy Chirper on 3 EC2 nodes • Lagom, ConductR and 12 factor apps

Lagom for Devops

Page 7: Managing Microservices in Production with lagom

Deploy

Page 8: Managing Microservices in Production with lagom

12 Factor Apps with Lagom & ConductR 12factor.net

Page 9: Managing Microservices in Production with lagom

I. Codebase One codebase tracked in revision control, many deploys

Page 10: Managing Microservices in Production with lagom

• Lagom • single repository • many services per “project”

I. Codebase

Page 11: Managing Microservices in Production with lagom

II. Dependencies Explicitly declare and isolate dependencies

Page 12: Managing Microservices in Production with lagom

•Bundles • self contained • verifiable and immutable • Docker and other containers • meta info including ACLs, resource requirements and startup config

II. Dependencies

Page 13: Managing Microservices in Production with lagom

III. Config Store config in the environment

Page 14: Managing Microservices in Production with lagom

• separate • verifiable and immutable • per bundle or across bundles

III. Config

Page 15: Managing Microservices in Production with lagom

IV. Backing services Treat backing services as attached resources

Page 16: Managing Microservices in Production with lagom

• no distinction to other services • local or remote services • service location • Amazon RDS, external service, JDBC (dynamic-data-source)

IV. Backing services

Page 17: Managing Microservices in Production with lagom

V. Build, release, run Strictly separate build and run stages

Page 18: Managing Microservices in Production with lagom

• build - sbt, “bundle:publish”, bintray • release - “conduct load”, resolvers, build artifact + config • run - “conduct run”

V. Build, release, run

Page 19: Managing Microservices in Production with lagom

VI. Processes Execute the app as one or more stateless processes

Page 20: Managing Microservices in Production with lagom

• bundle has components, components == process • share-nothing is a bit of a fallacy • DBs are shared • distributed pub-sub • CRDTs

VI. Processes

Page 21: Managing Microservices in Production with lagom

VII. Port binding Export services via port binding

Page 22: Managing Microservices in Production with lagom

• bind port • host port • proxy port (if a proxy is required) • *very* sophisticated proxy configuration (again, if required)

VII. Port binding

Page 23: Managing Microservices in Production with lagom

VIII. Concurrency Scale out via the process model

Page 24: Managing Microservices in Production with lagom

• scale up down at will • “conduct run x —scale y”

• resilient processes • automatically restarted

VIII. Concurrency

Page 25: Managing Microservices in Production with lagom

IX. Disposability Maximize robustness with fast startup and graceful shutdown

Page 26: Managing Microservices in Production with lagom

• replication • fast startup

• graceful termination • 10 seconds - sigkill

• auto scaling • 1.2 • process metrics based • statsd

IX. Disposability

Page 27: Managing Microservices in Production with lagom

X. Dev/prod parity Keep development, staging, and production as similar as possible

Page 28: Managing Microservices in Production with lagom

• sandbox cluster for development • uses Docker

• bundle publishing to bintray • resolver mechanism to support other repos

X. Dev/prod parity

Page 29: Managing Microservices in Production with lagom

XI. Logs Treat logs as event streams

Page 30: Managing Microservices in Production with lagom

• Elasticsearch • consolidated • “conduct logs”

• syslog

XI. Logs

Page 31: Managing Microservices in Production with lagom

XII. Admin processes Run admin/management tasks as one-off processes

Page 32: Managing Microservices in Production with lagom

• runAll for operations •CLI is composable • idempotent • composition the Unix way

XII. Admin processes

Page 33: Managing Microservices in Production with lagom