microservices: where spring cloud meets docker and consul

15
Dragan Gajic [email protected] MICROSERVICES: WHERE SPRING CLOUD MEETS DOCKER AND CONSUL

Upload: dragan-gajic

Post on 15-Apr-2017

982 views

Category:

Software


7 download

TRANSCRIPT

Page 1: Microservices: where Spring cloud meets docker and consul

Dragan [email protected]

MICROSERVICES: WHERE SPRING CLOUD MEETS DOCKER AND CONSUL

Page 2: Microservices: where Spring cloud meets docker and consul
Page 3: Microservices: where Spring cloud meets docker and consul

MONOLITHIC VS MICROSERVICES 1/2

�Web server

Web app

Web layer

Service/Business layer

Data/Persistence layer

Catalog Order

Customer

Database

Web Shop

SPA

Catalog App

Catalog

Order App

Order

Customer App

Customer

Page 4: Microservices: where Spring cloud meets docker and consul

Maintainability

Continuous Deployment

Scalability

Availability

Take advantage of emerging

technologies

Efficient governance

MONOLITHIC VS MICROSERVICES 2/2 code base size increases -> decrease maintainability overloaded IDE -> slow IDE -> decrease productivity overload web server -> long start -> decrease productivity

redeploy the entire app influence background tasks increases the risk -> discourages frequent updates

running more copies of the same app different components have different requirements

small code base size per MS faster IDE WS fast start

each service can be deployed independently smaller aps are easier to deploy downtime

low fault isolation

long time commitment to technology stack

hard to manage large teams agile is not scaling well hard to scale development

improved fault isolation Increased complexity - fail fast

scale on the level of MS

each MS can be developed using different stack

each (2 pizza) team responsible for one MS agile is working well easy to scale development

Page 5: Microservices: where Spring cloud meets docker and consul
Page 6: Microservices: where Spring cloud meets docker and consul

DISTRIBUTED SYSTEMS

• Configuration• Inter-service

communication• Discovery• Deployment• Orchestration• Testing• Distributed transactions• Versioning

Web Shop

SPA

Catalog App

Catalog

Order App

Order

Customer App

Customer

Page 7: Microservices: where Spring cloud meets docker and consul
Page 8: Microservices: where Spring cloud meets docker and consul

TO THE RESCUE

Page 9: Microservices: where Spring cloud meets docker and consul

DOCKER

• Lightweight virtualization• Images vs containers• Registry• Compose• Machine, Swarm,…

Page 10: Microservices: where Spring cloud meets docker and consul

CONSUL

• Distributed key/value store• Service discovery and health

check• Multi Datacenter support• Optimized sync protocols

(gossip)

• Alternatives• Netflix Eureka• Spring Cloud Config

Page 11: Microservices: where Spring cloud meets docker and consul

SPRING CLOUD

• Implements common patterns of distributed systems• Distributed configuration• Service discovery• Routing• Service-to-service calls• …

• Build on 12 factor app and Cloud Native principles

• Spring Boot

Page 12: Microservices: where Spring cloud meets docker and consul

DEMO

config/appName,dev/config/appName/config/application,dev/config/application

ms-demo-1:/echo ms-demo-2:/echo

ms-caller:/hello

Page 13: Microservices: where Spring cloud meets docker and consul

LESSONS LEARNED

• US breakdown• Keep your APIs under control• CD• Automated integration env• E2E automated tests• Don’t underestimate learning curve• After initial phase split the team accordingly

Page 15: Microservices: where Spring cloud meets docker and consul

ONE COMMON GOAL