63
Continuous Delivery & Micro Services A Symbiosis Eberhard Wolff Freelancer Head Technology Advisory Board adesso AG http://ewolff.com

Continuous Delivery and Micro Services - A Symbiosis

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

Page 1: Continuous Delivery and Micro Services - A Symbiosis

Continuous Delivery & Micro Services

A SymbiosisEberhard Wolff

Freelancer Head Technology Advisory

Board adesso AG http://ewolff.com

Page 2: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Leseprobe: http://bit.ly/CD-Buch

Page 3: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Micro Service

Page 4: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Page 5: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Page 6: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

How can I implement a

new feature???

Page 7: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff L

Page 8: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

ECommerce System

Spring & OSGi

New Stuff

Page 9: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

New Stuff Spring & OSGi

New Stuff

ECommerce System

Page 10: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

HTTP

New Stuff

Links

No legacy code Any technology

J Small code base

Page 11: Continuous Delivery and Micro Services - A Symbiosis

Little programs are delightful to write in

isolation,but the process of

maintaining large-scale software is always

miserable.

Jaron Lanier

Page 12: Continuous Delivery and Micro Services - A Symbiosis

Friedenspreis des

deutschen Buchhandels

Page 13: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Micro Services: Definition•  Small •  Independent deployment units •  i.e. processes

•  Any technology •  Any infrastructure

Micro Service

Server

Micro Service

Server

Page 14: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Components Collaborate

Micro Service

Micro Service

Link

Data Replication

REST Messaging

Page 15: Continuous Delivery and Micro Services - A Symbiosis

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

Page 16: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Continuous Delivery

Page 17: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Continuous Delivery: Build Pipeline

Commit Stage

Automated Acceptance

Testing

Automated Capacity Testing

Manual Explorative

Testing

Release

Page 18: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Continuous Delivery•  Automated provisioning

•  Fast Feedback •  Tests, tests, tests… •  Feedback from production •  Monitoring •  Logs analysis

Page 19: Continuous Delivery and Micro Services - A Symbiosis

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

Page 20: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Why Continuous Delivery Needs Micro Services

Page 21: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Monolith

ECommerce System

3rd party systems

Database

Page 22: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Continuous Delivery: Build Pipeline

Commit Stage

Automated Acceptance

Testing

Automated Capacity Testing

Manual Explorative

Testing

Release

ECommerce System

Page 23: Continuous Delivery and Micro Services - A Symbiosis

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

Page 24: Continuous Delivery and Micro Services - A Symbiosis

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

Page 25: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Micro Services

ECommerce System

3rd party systems

Database

Order

Customer

Item

Page 26: Continuous Delivery and Micro Services - A Symbiosis

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

Page 27: Continuous Delivery and Micro Services - A Symbiosis

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

Page 28: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Micro Services

ECommerce System

3rd party systems

Database

Order

Customer

Item

Page 29: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Micro Service & Databases•  Micro Services don’t share data •  i.e. database (schema) per server

•  Easier schema migration •  Easier deployment

Page 30: Continuous Delivery and Micro Services - A Symbiosis

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

Page 31: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Resilience

Page 32: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Resilience

A system built out of unreliable

components with resilience is more robust.

Page 33: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Would you reboot your database just

like that?

Page 34: Continuous Delivery and Micro Services - A Symbiosis

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

Page 35: Continuous Delivery and Micro Services - A Symbiosis

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

Page 36: Continuous Delivery and Micro Services - A Symbiosis

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

Page 37: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Why Micro Services Need

Continuous Delivery

Page 38: Continuous Delivery and Micro Services - A Symbiosis

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

Page 39: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Not one server

Page 40: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Not 10 server

Page 41: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

But a lot more

Page 42: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Micro Service: Not just a piece of

software

Page 43: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Micro ServiceApp +

App Server + Database +

More infrastructure

Individual technology stack

Page 44: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Micro Services & Automation•  Infrastructure much more complex •  More servers •  More services

•  Need to automate provisioning •  (Virtual) Servers •  Software •  Complete software stacks

Page 45: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Micro Services & Feedback: Logs

•  Simple grep on a log file not enough •  Too many servers •  Correlation across servers

•  Centralized logging needed

Page 46: Continuous Delivery and Micro Services - A Symbiosis

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

Page 47: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Why??

Page 48: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Quick Deployment

Continuous Delivery

Delivery Pipeline

Micro Services Smaller

Deployment Units

Independent Deployment

Units

Page 49: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Quick Deployment

Tests

Continuous Delivery

Monitoring

Logs Fast

Feedback

Page 50: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Conclusion

Page 51: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Micro Services & Continuous

Delivery: Goal is quick deployment.

Page 52: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Time to Market

Page 53: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Conclusion: Quick Deployments

Time

Size & Risk

Manual Deployment

Pipeline

Continuous Delivery Pipeline

Monolith Micro Services

Page 54: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Conclusion

Micro Services

Continuous Delivery

Infrastructure much more complex

Smaller deployment units

Page 55: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Micro Services and Continuous Delivery go together.

Page 56: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

You must do both: Continuous Delivery &

Micro Services

Page 57: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

You must do both: Continuous Delivery &

Micro Services

Page 58: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Migration to Continuous

Delivery or Micro Services much

harder

Page 59: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Migration to Continuous

Delivery or Micro Services much

harder

Page 60: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Continuous Delivery for a

Monolith might be unrealistic

Page 61: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Alternative Approach

ECommerce System

Database

Micro Service

Database

Integration

Page 62: Continuous Delivery and Micro Services - A Symbiosis

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

Page 63: Continuous Delivery and Micro Services - A Symbiosis

Eberhard Wolff - @ewolff

Thank You!