Microservices vs. Monoliths:The Definitive Shootout
November 06, 2018
Microservices vs. Monoliths: The Definitive Shootout
Shows how to choose between microservices and monoliths.
November 06, 2018
More Decks by Eberhard Wolff
See All by Eberhard Wolff
See All Featured
Eberhard Wolff Fellow INNOQ @ewolff http://ewolff.com
http://microservices-buch.de/ ueberblick.html http://microservices-book.com/ primer.html FREE!!!!
http://microservices-praxisbuch.de/ rezepte.html http://practical-microservices.com/ recipes.html FREE!!!!
What are Microservices?
Independent Systems Architecture: ISA http://isa-principles.org/
Modules Macro / Micro Architecture Independent Continuous Delivery Pipeline Resilience
Integration & Communication Authentication & Metadata Standardized Operations Standards: Interface only Container Independent Systems Architecture
What are Monoliths?
Monolith • Deployment monolith • Deploy the whole system at
once • Internal structure: Might be great or not so great… • A valid architecture
Compare Software Architectures? • Microservices and monoliths: valid architectures •
How can you compare software architectures? • What is software architecture?
Software Architecture • Technical solutions • ...to the problem at
hand. • Home-grown definition • Broad definition • See my talk on Thursday • Need to understand the problem!
Compare Software Architectures? • How does an architecture solve a
specific problem better? • What problem?
Problem 1: Standard Software • Deployed at many customers •
Looking for a better modularization • Outdated technologies
Problem 2: Internal System • Increase deployment frequency to multiple
per day • …for better time-to-market • …for less risk
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
Microservices: Deployment • Deploy individually • Requires automated deployment •
Easy with Docker, Kubernetes… • Requires decoupled components & tests • Enables faster deployments & tests • Enables frequent deployments
Monolith / Standard Software: Deployment • No too frequent deployment
• Deployment at customer site is complex anyways • Not every customer might use every new version.
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?
Monolith / Internal System: Deployment • Multiple deployments per day
with a monolith? • Main problem: test the whole system • No option
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?
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
Higher Deployment Frequency Improves Lead Time Reliability New Work %
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
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.
No Silver Bullet
No Silver Bullet Except for more frequent deployments?
How to improve from once a month (low) to multiple
times a day (elite) without microservices?
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
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
Monolith / Standard Software: Operation • Customer are used to
operate deployment monoliths • …and it is relatively easy
Microservices / Standard Software: Operation • Customer will have to
operate many microservices • Challenge • You should not make the life of your customers hard… • Show stopper
Microservices / Standard Software: Operation • Might change when Kubernetes/Istio
is ubiquitous • Could try to hide the microservices i.e. automated deployment with environment + microservices
Monolith / Internal System: Operation • The usual approach •
Operations can easily support it.
Microservices / Internal System: Operation • Requires investment in new
infrastructure • …but commodity nowadays. • Or use the cloud?
Changeability • Changes should be limited to one module. •
Changing multiple modules are harder.
Modules Microservice System
Modules Deployment Monolith
Modules Microservice System
Modules Deployment Monolith
Changeability • Monolith vs. microservices is just two ways to
implement modules. • How does it influence changeability?
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.
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.
Monolith / Standard Software: Changeability • Better changeability is a
major goal. • Old system had a deteriorated structure. • Well aware of the risk • Establish architecture management?
Microservices / Standard Software: Changeability • Would provide architecture firewalls
• Architecture management not really needed
Monolith / Internal System: Changeability • Considerable risk to mess
up the system • However, might still work out.
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
Microservices / Internal System: Changeability • Willing to take the
risk of deployment issues. • Strong boundaries help.
Migration • Your technology choices will be outdated sooner or
later. • Migrate to a new technology
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
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
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.
Microservices / Standard Software: Migration • Much better chances for
technology updates. • Stepwise • Option to migrate just parts
Monolith / Internal System: Migration • Actually not too important
• But still a potential issue
Microservices / Internal System: Migration • Nice additional benefit
Organization • Scale the organization • More people • More
communication • Limit communication needs. • Also see: Changeability • Changeability might limit communication needs.
Monolith: Migration • One common technological foundation • Must coordinate
technical decisions • One deployment • Must coordinate deployment i.e. features
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?
Monolith / Standard Software: Organization • Close coordination is a
huge problem at the moment. • Hard to decide about the features that go into a release.
Microservices / Standard Software: Organization • Less coordination • Constant
stream of new features
Monolith / Internal System: Organization • Close coordination • No
way to do experiments
Microservices / Internal System: Organization • Same as standard software
• Easy to experiment with new technologies and features
2 2 1 3 2
3 2 4 1
That was easy! J
If it is easy, it is probably wrong.
Conclusion • Standard Software = less frequent deployments • …and
operations at the customer • This makes all the difference • Consider your scenario! • SaaS would be very different.
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.
Conclusion • Did not talk about many other benefits of
microservices • Scalability • Security • Robustness • Technology freedom • See Microservices Primer