The Microservices Tax: Latency, Complexity, and Deployment Friction
Between 2018 and 2022, countless engineering teams split straightforward business applications into dozens of isolated microservices in the name of 'scalability'. For many teams without massive platform engineering headcount, this decision caused catastrophic operational friction.
Every network boundary introduces latency, serialization overhead, partial failure modes, complex distributed tracing, and eventual consistency nightmares. Instead of solving business problems, engineers spend months configuring service meshes and debugging cross-service transactions.
Unless your organization has hundreds of engineers building disjointed features that require independent release pipelines, microservices often create more distributed chaos than genuine technical benefit.
"Don't distribute your systems until you have thoroughly conquered the domain complexity inside a single deployment unit."
- A poorly designed monolith turns into a distributed spaghetti disaster when converted to microservices.
- Modular Monoliths enforce strict module boundaries within a single codebase, preserving fast compilation and direct database transactions.
- True microservices are an organizational scaling tool for hundreds of engineers, not a technical requirement for moderate traffic.
The Modular Monolith: The Pragmatic Sweet Spot
A Modular Monolith structures code into strictly decoupled functional modules (e.g., Billing, Inventory, Authentication, Notifications). Each module owns its internal data schemas and communicates only through explicit public interfaces.
By housing all modules within a single repository and single deployment artifact, developers retain the benefits of instant local setup, single-transaction database ACID guarantees, straightforward end-to-end integration tests, and shared TypeScript types.
If a specific module later requires distinct scaling characteristics (such as a compute-heavy video rendering engine or a high-throughput webhook receiver), it can be extracted cleanly into an independent microservice with minimal refactoring.
// modules/billing/index.ts (Public API of the Billing Module)
// Other modules are strictly prohibited from importing billing internal files directly.
export interface InvoiceReceipt {
invoiceId: string;
totalPaid: number;
currency: string;
status: "SETTLED" | "PENDING";
}
export class BillingService {
static async chargeCustomer(customerId: string, amount: number): Promise<InvoiceReceipt> {
// Internal private billing logic, payment gateway interactions, and ledger updates
return await processBillingTransaction(customerId, amount);
}
}Handling Distributed Data: Event-Driven Transitions
When you eventually need to separate a module into an independent service, synchronous HTTP REST calls between services must be avoided. Synchronous chains create cascading failures: if Service C goes down, Service B fails, and Service A times out.
Modern architectures rely on Event-Driven Architecture (EDA) powered by message brokers like Apache Kafka, RabbitMQ, or AWS SQS. When an order is placed, an `OrderCreated` event is published to the bus, allowing Billing, Shipping, and Email services to react asynchronously without blocking the user response.
Architecture Decision Framework: Which Model to Pick
Follow this pragmatic checklist before adopting microservices:
1. Team Topology: Do you have at least 3-4 distinct cross-functional squads that constantly conflict during Git merges and release schedules?
2. Asymmetrical Resource Demands: Does a specific component require 100x more GPU or RAM than the rest of the web application?
3. Fault Isolation: Must the checkout system stay 100% operational even if the recommendation algorithm crashes entirely?
If the answer to these questions is 'no', start with a beautifully architected Modular Monolith.