Upload
eberhard-wolff
View
1.196
Download
2
Embed Size (px)
DESCRIPTION
Continuous Delivery profits from Micro Services - and the other way round. This presentation shows how the two technologies work together - and how Micro Services can be used to simplify the transition to Continuous Delivery.
Citation preview
Continuous Delivery & Micro Services
A SymbiosisEberhard Wolff
Freelancer Head Technology Advisory
Board adesso AG http://ewolff.com
Eberhard Wolff - @ewolff
Leseprobe: http://bit.ly/CD-Buch
Eberhard Wolff - @ewolff
Micro Service
Eberhard Wolff - @ewolff
Eberhard Wolff - @ewolff
Eberhard Wolff - @ewolff
How can I implement a
new feature???
Eberhard Wolff - @ewolff L
Eberhard Wolff - @ewolff
ECommerce System
Spring & OSGi
New Stuff
Eberhard Wolff - @ewolff
New Stuff Spring & OSGi
New Stuff
ECommerce System
Eberhard Wolff - @ewolff
HTTP
New Stuff
Links
No legacy code Any technology
J Small code base
Little programs are delightful to write in
isolation,but the process of
maintaining large-scale software is always
miserable.
Jaron Lanier
Friedenspreis des
deutschen Buchhandels
Eberhard Wolff - @ewolff
Micro Services: Definition• Small • Independent deployment units • i.e. processes
• Any technology • Any infrastructure
Micro Service
Server
Micro Service
Server
Eberhard Wolff - @ewolff
Components Collaborate
Micro Service
Micro Service
Link
Data Replication
REST Messaging
Eberhard Wolff - @ewolff
Why Micro Services?• Strong modularization • i.e. no unwanted dependencies
• Choose best technology for each service • Includes database etc
• Teams can deploy new features • Completely independent • Micro Service must provide meaningful
set of features
Eberhard Wolff - @ewolff
Continuous Delivery
Eberhard Wolff - @ewolff
Continuous Delivery: Build Pipeline
Commit Stage
Automated Acceptance
Testing
Automated Capacity Testing
Manual Explorative
Testing
Release
Eberhard Wolff - @ewolff
Continuous Delivery• Automated provisioning
• Fast Feedback • Tests, tests, tests… • Feedback from production • Monitoring • Logs analysis
Eberhard Wolff - @ewolff
Why Continuous Delivery?• Faster time to market • i.e. can deploy changes quickly into
production
• Less risk • Many tests • Automation mean reproducible results • Smaller deployments
Eberhard Wolff - @ewolff
Why Continuous Delivery Needs Micro Services
Eberhard Wolff - @ewolff
Monolith
ECommerce System
3rd party systems
Database
Eberhard Wolff - @ewolff
Continuous Delivery: Build Pipeline
Commit Stage
Automated Acceptance
Testing
Automated Capacity Testing
Manual Explorative
Testing
Release
ECommerce System
Eberhard Wolff - @ewolff
Build Pipeline: Problems• Complex infrastructure • Huge database • 3rd party integration
• Slow feedback • Test everything for each commit • Huge deployment unit • Deployment slow
Eberhard Wolff - @ewolff
Micro Services• Small independent deployment units • E.g. interface backwards compatibility • Otherwise Micro Services would need
to be deployed together
• Sensible set of features • Business features should be deployed
independently
Eberhard Wolff - @ewolff
Micro Services
ECommerce System
3rd party systems
Database
Order
Customer
Item
Eberhard Wolff - @ewolff
Commit Stage
Automated Acceptance
Testing Automated
Capacity Testing
Manual Explorative
Testing
Release
Commit Stage
Automated Acceptance
Testing Automated
Capacity Testing
Manual Explorative
Testing
Release
Commit Stage
Automated Acceptance
Testing Automated
Capacity Testing
Manual Explorative
Testing
Release Order
Item
Customer
Eberhard Wolff - @ewolff
Build Pipeline for Micro Services
• Independent deployment • Build pipeline per Micro Service
• Smaller • Easier to set up • Less features (3rd party systems) • Faster Feedback: Less tests
Eberhard Wolff - @ewolff
Micro Services
ECommerce System
3rd party systems
Database
Order
Customer
Item
Eberhard Wolff - @ewolff
Micro Service & Databases• Micro Services don’t share data • i.e. database (schema) per server
• Easier schema migration • Easier deployment
Eberhard Wolff - @ewolff
Micro Services Design• System becomes a distributed system
• The network is not reliable • Micro Services fail
• A failed Micro Services must not cause other to fail
Eberhard Wolff - @ewolff
Resilience
Eberhard Wolff - @ewolff
Resilience
A system built out of unreliable
components with resilience is more robust.
Eberhard Wolff - @ewolff
Would you reboot your database just
like that?
Eberhard Wolff - @ewolff
Amazon Reboot• Amazon Cloud rebooted several
machines • Netflix: video streaming • Peak: 30% of internet traffic in the US • 2700 database server • 218 rebooted • 22 not successful • 0 downtime
Eberhard Wolff - @ewolff
Risk Mitigation in Continuous Delivery
• Blue / Green Deployment • Create complete cluster with new
release • Test and only switch if OK
• Canary Releasing • Release to a few nodes • Rollback if needed
Eberhard Wolff - @ewolff
Micro Services: Further Risk Mitigation
• Smaller deployment units • Deployment Failure influences less
features • Easier rollback / fixing
• Resilience: Other Micro Services still operational
Eberhard Wolff - @ewolff
Why Micro Services Need
Continuous Delivery
Eberhard Wolff - @ewolff
Micro Service & Servers• Potentially different technology
stack per service • Individual processes
• Each component has its own server • …per stage in the pipeline
Eberhard Wolff - @ewolff
Not one server
Eberhard Wolff - @ewolff
Not 10 server
Eberhard Wolff - @ewolff
But a lot more
Eberhard Wolff - @ewolff
Micro Service: Not just a piece of
software
Eberhard Wolff - @ewolff
Micro ServiceApp +
App Server + Database +
More infrastructure
Individual technology stack
Eberhard Wolff - @ewolff
Micro Services & Automation• Infrastructure much more complex • More servers • More services
• Need to automate provisioning • (Virtual) Servers • Software • Complete software stacks
Eberhard Wolff - @ewolff
Micro Services & Feedback: Logs
• Simple grep on a log file not enough • Too many servers • Correlation across servers
• Centralized logging needed
Eberhard Wolff - @ewolff
Micro Services & Feedback: Monitoring
• Just top on a server is not enough • Too many servers • Not just your application… • …also database • …other infrastructure
• Centralized monitoring needed
Eberhard Wolff - @ewolff
Why??
Eberhard Wolff - @ewolff
Quick Deployment
Continuous Delivery
Delivery Pipeline
Micro Services Smaller
Deployment Units
Independent Deployment
Units
Eberhard Wolff - @ewolff
Quick Deployment
Tests
Continuous Delivery
Monitoring
Logs Fast
Feedback
Eberhard Wolff - @ewolff
Conclusion
Eberhard Wolff - @ewolff
Micro Services & Continuous
Delivery: Goal is quick deployment.
Eberhard Wolff - @ewolff
Time to Market
Eberhard Wolff - @ewolff
Conclusion: Quick Deployments
Time
Size & Risk
Manual Deployment
Pipeline
Continuous Delivery Pipeline
Monolith Micro Services
Eberhard Wolff - @ewolff
Conclusion
Micro Services
Continuous Delivery
Infrastructure much more complex
Smaller deployment units
Eberhard Wolff - @ewolff
Micro Services and Continuous Delivery go together.
Eberhard Wolff - @ewolff
You must do both: Continuous Delivery &
Micro Services
Eberhard Wolff - @ewolff
You must do both: Continuous Delivery &
Micro Services
Eberhard Wolff - @ewolff
Migration to Continuous
Delivery or Micro Services much
harder
Eberhard Wolff - @ewolff
Migration to Continuous
Delivery or Micro Services much
harder
Eberhard Wolff - @ewolff
Continuous Delivery for a
Monolith might be unrealistic
Eberhard Wolff - @ewolff
Alternative Approach
ECommerce System
Database
Micro Service
Database
Integration
Eberhard Wolff - @ewolff
Migration to Micro Service and Continuous Delivery
• Micro Services can be added to a Monolith
• Might use different technologies • Different way to handle legacy
applications • Easier to create a Continuous
Delivery Pipeline for Micro Service • But: Higher overall complexity
Eberhard Wolff - @ewolff
Thank You!