deploying microservice architectures with spring cloud on cloud foundry
TRANSCRIPT
Deploying Microservices with Spring Cloud to
1
Matt Stine wrote a little cloud book...
FREE - Compliments of Pivotal
http://bit.ly/cloud-native-book
Download the PDF for free!
2
Why is Cloud Foundry such an ideal deployment
platform for microservices?
3
If you're smart, start with a
MONOLITH.4
Make it 12 Factor
5
Eventually things get bigger...
6
...and it becomes time to decompose.
7
Microservices?
8
Loosely coupled service oriented architecture with
bounded contexts...— Adrian Cockcroft
9
You must be this tall to use Microservices
• RAPID PROVISIONING
• BASIC MONITORING
• RAPID APPLICATION DEPLOYMENT
• DEVOPS CULTURE
http://martinfowler.com/bliki/MicroservicePrerequisites.html
10
A Symbiotic Relationship
11
Platform Features• Environment Provisioning
• On-Demand Scaling
• Failover/Resilience
• Routing/Load Balancing
• Data Service Operations (BOSH)
• Monitoring
12
No Microserviceis an Island
13
Some Challenges of Distributed Systems• Configuration Management
• Service Registration & Discovery
• Routing & Load Balancing
• Fault Tolerance
• Monitoring
14
We need a representation of the composite system!
15
The BIG A App
16
---memory: 512Minstances: 1no-route: trueservices: - cloudamqp-autoscaleapplications:- name: worker-process path: worker-process/build/libs/worker-process.jar- name: producer-process path: producer/build/libs/producer.jar- name: autoscaler-process path: autoscaler/build/libs/autoscaler.jar- name: autoscale-monitor no-route: false host: autoscale-monitor-${random-word} path: monitor/build/libs/monitor.jar
17
Staticvs.
Dynamic18
Like BOSH, but for microservices?
19
DecentralizedAutonomousCapability
Teams / Services20
You write it, you run it!
21
22
Spring CloudDistributed System Patterns FTW!
23
App/ServiceLevel
Patterns24
Deploying/Running Apps
vs.Composing Fault Tolerant Systems
25
Spring Cloud + Netflix OSS• Config Server / Cloud Bus
• Eureka (Service Registry)
• Ribbon (Load Balancer)
• Hystrix (Circuit Breakers)
• Zuul (Intelligent Routing)
26
Works on Lattice too!
https://lattice.cf27
Config Server
28
Config Server + Cloud Bus
29
DEMO30
Eureka (Service Registry)
31
DEMORibbon (Load Balancer)
32
Before cf_release v204
33
cf_release v195"CF_INSTANCE_INDEX"=>"0","CF_INSTANCE_IP"=>"1.2.3.4","CF_INSTANCE_PORT"=>"5678","CF_INSTANCE_ADDR"=>"1.2.3.4:5678","CF_INSTANCE_PORTS"=>[{external:80,internal:5678}]
34
cf_release v204properties: dea_next: allow_host_access: true
35
After cf_release v204
36
DEMO37
Hystrix (Circuit Breaker)
38
DEMO39
Zuul (Intelligent Routing)
40
DEMO41
Spring Cloud FUTURES• Alternative Stacks (Consul, Zookeeper, etcd, JRugged, ...)
• Distributed Request Tracing/Correlation (i.e. Dapper/Zipkin)
• Stateful Patterns (Leader Election, Locks, State Machine)
• Developer Workflow Improvements
• Switches (Canaries, Feature Toggles, Surgical Routing, ...)
• ???
42
Learn MOAR• http://cloud.spring.io
• http://spring.io/blog/2015/04/06/lattice-and-spring-cloud-resilient-sub-structure-for-your-cloud-native-spring-applications
• http://lattice.cf
• http://netflix.github.io
43
THANK YOU• THIS TALK: https://github.com/pieterhumphrey/devoxxPL
• DEMOS: https://github.com/mstine/intro-spring-cloud-workshop/tree/lattice
44