Microservices Costs, Traffic, and Eventual Consistency
The tradeoff of breaking the monolith
Microservices solve team, deployment, and selective-scaling bottlenecks (see Scalability and Software Monoliths), but they convert a single-process program into a distributed system. Every interaction that used to happen in memory now crosses the network.
North-South vs. East-West traffic
Network architects classify datacenter traffic into two directions:
- North-South (NS) traffic: Traffic between users on the public Internet and servers/microservices inside the datacenter.
- East-West (EW) traffic: Internal machine-to-machine traffic from one server or microservice to another.
In a monolith, one user request triggers internal function calls inside RAM. In microservices, that single North-South request fans out into many internal East-West network calls:
- Typical ratio: At least 10% North-South / 90% East-West in most microservice applications.
- Hyperscale evidence: Meta (2014 engineering blog and 2025 CACM paper) reports that internal East-West traffic among datacenters and Points of Presence exceeds external user-facing traffic by several orders of magnitude, driven by microservice calls and data replication.
Network calls, serialization, and partial failures
Between microservices there are no local function calls or shared memory—only sockets. Every hop incurs:
- Added latency: Network round-trips are far slower than in-memory procedure calls.
- Data serialization: Request and response objects must be marshalled/unmarshalled (e.g., JSON or binary formats) at both ends.
- Partial failures: In a monolith, the whole process succeeds or crashes together. Over a network, one service can complete its work while a downstream service drops packets or times out.
Harder data consistency: eventual consistency
To scale independently, each microservice owns its own database. As a result, a business action spanning multiple services can no longer be wrapped in one all-or-nothing database transaction.
Instead, microservice systems typically accept eventual consistency: for a short interval after an operation starts, different services can disagree on system state until asynchronous events or compensating actions finish propagating.
Concrete failure trace: Online Boutique checkout
- Initial state: A customer clicks “Buy” (
Frontend->CheckoutService).CheckoutServicemust charge the card (PaymentService), empty the cart (CartService), and schedule delivery (ShippingService). - Step 1 (succeeds):
CheckoutServicecallsPaymentServiceover the network;PaymentServicecommits the charge in its own database. - Step 2 (fails):
CheckoutServicecallsShippingService, which crashes or times out before persisting the shipment. - Consequence: Unlike a monolithic database rollback,
PaymentServicecannot automatically undo its committed charge just becauseShippingServicefailed. Temporarily, the payment service records a paid order while shipping has no record of it—requiring explicit retry or compensation workflows to restore consistency.
Dynamic addressing and distributed observability
- No
localhostor local IPC: Services run across different hosts and restart dynamically. Every caller needs service discovery to answer “What is the current IP address of the database or service I need?” - Distributed debugging and tracing: A single user request traverses many containers across a datacenter, and traffic/placement is mediated by an orchestrator that developers may not directly control. Teams must aggregate and correlate distributed logs and traces across services just to diagnose a single bug.
Not right for everybody
Microservices add real infrastructure, latency, and operational cost. In a notable 2023 case cited in the lecture, Amazon Prime Video moved its video-quality monitoring service from serverless microservices back to a monolith and reduced its infrastructure costs by roughly 90%. Microservices pay off only when organizational or workload scaling demands them.
Common confusions
- Eventual consistency is not permanent corruption: Services temporarily disagree during propagation or partial failures, rather than giving up consistency entirely—but the application must be designed to tolerate or reconcile those intermediate states.
- High East-West traffic does not come from users directly: Even modest external user traffic can saturate internal datacenter networks if each request fans out into dozens of chained microservice calls.
Retrieval
- In a microservice e-commerce checkout, classify (a) the user’s browser request to
Frontendand (b)CheckoutServicecallingPaymentServiceandShippingService, and explain why East-West traffic typically dominates.
(a) Browser-to-Frontendis North-South traffic (public Internet <-> datacenter); (b)CheckoutServicecallingPaymentServiceandShippingServiceis East-West traffic (service <-> service). East-West dominates (typically ≥ 90%) because each single user action triggers multiple internal service calls and data replication hops. - Why can a monolith roll back a failed checkout in one database transaction while a microservice architecture ends up with eventual consistency?
A monolith shares one centralized database where a single ACID transaction rolls back all changes if any step fails. In microservices, each service owns a separate database to scale independently, so multi-service operations span independent nodes and can temporarily disagree.
Source: Lecture 10 - Microservices and Containers Orchestration, PDF pages 16–19.