12 The Great Debate: Monoliths vs. Microservices: Navigating the Distributed Divide
This chapter covers
- Navigating the architectural spectrum: Monoliths, Modular Monoliths, and Microservices.
- Understanding why "Monolith" is not a dirty word.
- Using the Strangler Fig pattern to safely evolve a legacy system.
- The hidden networking costs of distributed architectures.
- What a 1960s MIT Beer Game teaches us about cascading microservice failures.
12.1 Introduction
Welcome to Part IV: Architecture in the Real World. Over the last eleven chapters, you have acquired a formidable toolkit. You know how to structure code with SOLID principles, isolate business logic using Hexagonal Architecture, communicate via REST and Events, and deploy to the cloud using Infrastructure as Code.
But now, as a Clarity Engineer, you face one of the most hotly debated macro-architectural decisions in the industry: How do you package and deploy all of that beautiful code?
For quite some time, the software industry has been locked in a steel-cage wrestling match. In one corner, we have the Monolith, standing 7 feet, 5 inches tall and weighing in at 550 lbs, from the "Wrong Side of the Tracks" in the Southside of Chicago: the ultimate "Heel", often unfairly stereotyped as a massive, tangled, legacy hairball.
In the other corner, we have Microservices, a relentless, high-flying tag-team stable of five masked luchadors, each weighing exactly 120 lbs: hailed as the modern, scalable "Faces" of enterprise software.