Holub: Don't Default to Microservices

Engineer Allen Holub is cautioning against a "microservices first" mindset in system architecture. He argues that while microservices offer fault-tolerance, they introduce significant complexity and network latency. Holub suggests teams should match patterns to needs, and consider hybrid approaches like threaded components in a monolith for simpler scaling scenarios.

The "monolith-first" strategy is advocated by thought leaders like Martin Fowler, who argues that starting with a monolith allows a system's boundaries to emerge organically. Attempting to define service boundaries from the outset is difficult even for experienced architects, and incorrect boundaries are much harder to refactor in a distributed system than in a single codebase. Microservices introduce significant operational complexity and costs that are often underestimated. This includes increased memory and CPU consumption, network latency for inter-service communication, and the need for sophisticated deployment automation and monitoring tools to manage the distributed system. This complexity doesn't just live in the code; it moves into the coordination between teams, slowing down development as organizations scale. The shift to microservices often leads to challenges in data management and consistency. With each microservice owning its own database, ensuring data integrity across services requires complex patterns like event sourcing or distributed transactions, which add another layer of fragility and development overhead. Debugging a single request can become a major challenge, requiring distributed tracing and log aggregation to track down issues that would be a simple stack trace in a monolith. High-profile case studies have emerged of companies moving from microservices back to a monolith, citing significant benefits. Amazon Prime Video famously reduced its infrastructure costs by over 90% by moving its video monitoring system from a distributed architecture to a single monolithic application, also gaining increased scaling capabilities. Segment, now part of Twilio, also reverted from over 150 microservices to a monolithic service after finding that the operational overhead was hampering engineering productivity. These moves highlight a growing trend of re-evaluating the automatic adoption of microservices in favor of more pragmatic architectural choices. The emerging consensus is not a wholesale rejection of microservices, but a move towards more intentional architecture. The "modular monolith" is gaining traction as a viable alternative, offering clear separation of concerns within a single deployable unit, without the "distributed tax" of network calls and operational complexity. This modular approach allows for a more graceful evolution; well-defined modules within a monolith can be extracted into separate services if and when a genuine, specific need for independent scaling or deployment arises. This strategy provides a path to microservices without the premature complexity, embodying the principle of "You Aren't Gonna Need It" (YAGNI).

Get your own daily briefing

Scout delivers personalized news, insights, and conversations tailored to your role and industry.

Download on the App Store

Shared from Scout - Be the smartest in the room.