Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Microservices vs. Monoliths: The Definitive Sho...

Eberhard Wolff
November 06, 2018
280

Microservices vs. Monoliths: The Definitive Shootout

Shows how to choose between microservices and monoliths.

Eberhard Wolff

November 06, 2018
Tweet

Transcript

  1. Modules Macro / Micro Architecture Independent Continuous Delivery Pipeline Resilience

    Integration & Communication Authentication & Metadata Standardized Operations Standards: Interface only Container Independent Systems Architecture
  2. Monolith • Deployment monolith • Deploy the whole system at

    once • Internal structure: Might be great or not so great… • A valid architecture
  3. Compare Software Architectures? • Microservices and monoliths: valid architectures •

    How can you compare software architectures? • What is software architecture?
  4. Software Architecture • Technical solutions • ...to the problem at

    hand. • Home-grown definition • Broad definition • See my talk on Thursday • Need to understand the problem!
  5. Problem 1: Standard Software • Deployed at many customers •

    Looking for a better modularization • Outdated technologies
  6. Problem 2: Internal System • Increase deployment frequency to multiple

    per day • …for better time-to-market • …for less risk
  7. Monolith: Deployment • Deploy all at once • Simpler? •

    It is hard to deploy a large system • Tests are even harder • Tests and deployment can take loooooong – days, weeks, months • So large infrequent deployments • Risky
  8. Microservices: Deployment • Deploy individually • Requires automated deployment •

    Easy with Docker, Kubernetes… • Requires decoupled components & tests • Enables faster deployments & tests • Enables frequent deployments
  9. Monolith / Standard Software: Deployment • No too frequent deployment

    • Deployment at customer site is complex anyways • Not every customer might use every new version.
  10. Microservices / Standard Software: Deployment • Push out a large

    number of microservices to many customers? • Hard • …or a competitive advantage? • How many deployments on your mobile phone each day?
  11. Monolith / Internal System: Deployment • Multiple deployments per day

    with a monolith? • Main problem: test the whole system • No option
  12. Microservices / Internal System: Deployment • Deploy and test each

    microservice in isolation. • Much less tests • Very fast deployment • How can you do multiple deployments per day without microservices?
  13. Deployment Frequency: Results • Elite Performers vs. Low Performers •

    Multiple times per day vs. once per week / month • 2.555x better lead time for change • 2.604x better time to restore service • 7x better change failure rate • 50% vs 30% time spent on new work
  14. MAERSK COST OF DELAY POWER LAW CURVE 200K 10 30

    60 70 80 20 50 40 Number of Requirements 1.2MM 2.2MM 400K 1.4MM 2.4MM 600K 1.6MM 2.6MM 1MM 2MM 1.8MM 2.8MM Cost of Delay/Week Source: State of DevOps Report, blackswarmfarming.com
  15. No Silver Bullet Essence and Accident in Software Engineering Frederick

    P. Brooks, Jr. There is no single development... which by itself promises even one order-of-magnitude improvement within a decade in productivity, in reliability, in simplicity.
  16. How to improve from once a month (low) to multiple

    times a day (elite) without microservices?
  17. Monolith: Operation • One process • One source for logging,

    monitoring … • But: complex interaction with many 3rd party systems • What most operations team know and support best
  18. Microservices: Operation • Requires federated logging, monitoring … • Commodity:

    Elastic stack, Prometheus, Istio… • Each microservice has limited interaction with 3rd parties • Easy to scale just one microservice
  19. Monolith / Standard Software: Operation • Customer are used to

    operate deployment monoliths • …and it is relatively easy
  20. Microservices / Standard Software: Operation • Customer will have to

    operate many microservices • Challenge • You should not make the life of your customers hard… • Show stopper
  21. Microservices / Standard Software: Operation • Might change when Kubernetes/Istio

    is ubiquitous • Could try to hide the microservices i.e. automated deployment with environment + microservices
  22. Microservices / Internal System: Operation • Requires investment in new

    infrastructure • …but commodity nowadays. • Or use the cloud?
  23. Changeability • Monolith vs. microservices is just two ways to

    implement modules. • How does it influence changeability?
  24. Monolith: Changeability • Far too often badly structured. • …even

    though there could be well structured monoliths. • Reason: Easy to cross module boundaries. • Even changes to many modules can be deployed in one deployment.
  25. Microservices: Changeability • Microservices have strong boundaries i.e. a REST

    API. • Support good structure • Higher Risk: Badly structured microservices system is hard to change and deploy. • Microservices: Harder to mess up …but severe consequences if messed up.
  26. Monolith / Standard Software: Changeability • Better changeability is a

    major goal. • Old system had a deteriorated structure. • Well aware of the risk • Establish architecture management?
  27. Monolith / Internal System: Changeability • Considerable risk to mess

    up the system • However, might still work out.
  28. Microservices / Internal System: Changeability • Can not just change

    the software… • …but put it into production more easily • …where it generates value. • Changes not in production = waste
  29. Microservices / Internal System: Changeability • Willing to take the

    risk of deployment issues. • Strong boundaries help.
  30. Monolith: Migration • Changing the technology means updating the full

    monolith. • “Big Bang” • Even updating from a standard to a new standard might be hard. • E.g. Java EE
  31. Microservices: Migration • Each microservice might use a different technology.

    • Easy to migrate stepwise • Can keep outdated technologies in less relevant microservices …to save money. • Easy to experiment with new technologies
  32. Monolith / Standard Software: Migration • Old system had an

    outdated technology stack • Technology update driver to look for alternatives. • Monoliths would still be hard to keep up to date.
  33. Microservices / Standard Software: Migration • Much better chances for

    technology updates. • Stepwise • Option to migrate just parts
  34. Organization • Scale the organization • More people • More

    communication • Limit communication needs. • Also see: Changeability • Changeability might limit communication needs.
  35. Monolith: Migration • One common technological foundation • Must coordinate

    technical decisions • One deployment • Must coordinate deployment i.e. features
  36. Microservices: Migration • Technical decision can be made per microservice.

    • Can still enforce standards. • Deployment per microservice • …no need to coordinate releases • Remember the separated continuous delivery pipelines?
  37. Monolith / Standard Software: Organization • Close coordination is a

    huge problem at the moment. • Hard to decide about the features that go into a release.
  38. Microservices / Internal System: Organization • Same as standard software

    • Easy to experiment with new technologies and features
  39. Conclusion • Standard Software = less frequent deployments • …and

    operations at the customer • This makes all the difference • Consider your scenario! • SaaS would be very different.
  40. Conclusion • More frequent deployments has many advantages. • Lead

    time to change, stability, more new work • Consider more frequent deployments! • Standard software -> SaaS? App Store? • Microservices are a prerequisite for more frequent deployments.
  41. Conclusion • Did not talk about many other benefits of

    microservices • Scalability • Security • Robustness • Technology freedom • See Microservices Primer