Monoliths vs Microservices ๐ฟ
All the technical and organizational tradeoffs and how to choose between them, or anything in between.
Hey ๐ this is Luca! Welcome to a new ๐ weekly edition ๐ of Refactoring.
Every week I write advice on how to become a better engineering leader, backed by my own experience, research and case studies.
Here are the latest articles you may have missed:
To receive all the full articles and support Refactoring, consider subscribing ๐
You can also learn more about theย benefits of a paid plan.
In the book Sapiens, historian Yuval Noah Harari spends some initial chapters explaining the transition of humans from the hunter-gatherer lifestyle to the farmer one.
In doing so, he debunks several myths about the life of prehistoric men.
Hunter-gatherers lived a simple, happy life: they had a diverse diet, famine was rare, they were physically fit, and, contrary to popular belief, they only had to work a few hours a day.
The transition to farming, instead, brought some unexpected setbacks. Farmers had to work long hours, sometimes twice as much as their ancestors did. Their health got worse because of intense work, bad diet (mainly carbs), and diseases brought on by the poor hygiene of primordial villages.
The farmer lifestyle had one main upside, though: it produced more food, which would sustain the creation of larger communities.
In other words, life sucked at pretty much everything, but hey โ it was scalable now!
Does it remind you of anything?
The first farmers were pretty much the engineers of the prehistoric world. To their defense, nobody chose to make their own life worse on purpose โ on paper, odds where overwhelmingly in favor of farming life. Most downsides were not obvious (e.g. diseases, diet problems) and wouldnโt be so until generations later.
Many big engineering choices are similar. Implications are far reaching, and we may fail to account for the second and third-order consequences.
One of the most divisive of such choices is about monoliths vs microservices, as a strategy for designing our systems.
This article tries to shed light into the tradeoffs, upsides and downsides of both (or anything in between), both from the technical and organizational point of view.
We will go through:
๐ Definitions โ Letโs get everyone on the same page.
โ๏ธ System Design โ How is design effort different? And when is it worth it?
๐ Scalability โ Do microservices scale better than monoliths? Spoiler, itโs complicated.
๐ย Productivity โ Does your dev process change based on your architecture? You bet it!
๐ Case Studies โ Three real-world stories of evolving monoliths and microservices.
โ๏ธ How to decide โ Letโs bottom-line all of this and figure out whatโs the best for you.
Letโs go!