Skip to content
Novandri.

Microservices Architecture: Service Mesh, Event-Driven, Saga Pattern

Microservices buy independent deployment by adding distributed-systems problems. Read the actual trade-off, the patterns that manage it, and a decision test.

Rachmadwipa Novandri8 min read

Microservices are often described as "small services", which misses the point. The size is incidental; the goal is independent change. A team should be able to deploy its service without coordinating a release with every other team. Everything else in the architecture — service mesh, events, sagas — exists to manage the consequences of that independence.

Direct answer: Martin Fowler and James Lewis observe that "there is no precise definition" of microservice architecture, but identify common characteristics: "organization around business capability, automated deployment, intelligence in the endpoints, and decentralized control of languages and data".

The boundary is explicit in their article's section title, "Synchronous calls considered harmful": splitting a system into services does not make the distributed problems disappear, it makes them visible.

The patterns in the title are answers to those problems, not decorations.

A four-step flow: split by capability, deploy independently, handle calls and events, then use sagas for consistency.
Conceptual: the patterns manage the consequences. Splitting a system does not make distributed problems disappear; it makes them visible.

What independence costs

A monolith has one deployment pipeline, one database, and in-process function calls. A microservice system has many pipelines, separate data stores, and network calls that can fail, stall, or return stale data.

Four consequences follow:

Failure becomes partial. A dependency can be down while your service is healthy. The circuit-breaker pattern that Fowler's article discusses as "production ready code" exists so that a failing dependency does not occupy your threads indefinitely.

Data becomes distributed. "Decentralized control of languages and data" means each service owns its data. A transaction that once touched one database now spans several, and the atomic guarantee is gone.

Calls become expensive. A remote call is orders of magnitude slower than a function call and can fail in ways a function call cannot. Fowler's "intelligence in the endpoints" means services handle their own logic, but it also means each hop has a cost.

Operations become a product. Automated deployment, monitoring, and tracing are prerequisites, not extras. A team without them will find that its "independent" services are coupled through a shared, manual release process.

The three patterns and the problems they solve

Service mesh moves cross-cutting communication concerns — service discovery, retries, encryption, telemetry — out of application code into a dedicated infrastructure layer. The benefit is consistency: every service gets the same behaviour without each team implementing it. The cost is another component to operate and a new place for latency to hide.

Event-driven communication replaces a direct call with a published event. The producer does not need to know who consumes it, which decouples teams in time as well as deployment. CloudEvents, the CNCF specification, exists to make event descriptions portable across platforms. The trade-off is that delivery becomes asynchronous and eventually consistent: the consumer may react seconds later, or not at all, and the producer needs a way to detect that.

Saga pattern addresses the lost transaction. A saga is a sequence of local transactions, each with a compensating action. If step three fails, the system runs the compensations for steps two and one rather than rolling back a distributed transaction that never existed. The hard part is designing compensations that are genuinely reversible — a sent email is not.

AMQP, the OASIS standard for message queuing, is one substrate for reliable event transport. It provides the protocol, not the business semantics; deciding what an event means remains an application concern.

A worked example of a call chain

Suppose an order request passes through five services: API gateway → orders → payments → inventory → notifications. Each network hop has a median latency of 20 ms and a 0.5% chance of failure.

  • Serial chain latency: 5 × 20 ms = 100 ms, before any business logic. Add a database query of 10 ms at each of orders, payments, and inventory, and the total is 130 ms.
  • Success probability: (0.995)^5 ≈ 97.5%. Roughly one request in forty fails because of an infrastructure hop, even if every service is correct.

Two design changes alter this:

  1. Parallelise independent calls. If inventory and payments do not depend on each other, calling them together reduces the network portion from 40 ms to 20 ms — a 15% improvement on the 130 ms total.
  2. Publish notifications as an event. Removing the synchronous notification hop cuts 20 ms and one failure point. The user's confirmation no longer waits for the email system.

The numbers are hypothetical, but the method is not: a call chain should be measured in hops and failure probabilities, not described as "a simple microservice architecture".

The same arithmetic applies to retries. A retry with exponential backoff improves the chance of success but increases latency and can amplify an outage when many clients retry at once — which is why a circuit breaker and jitter matter.

The database-per-service decision

The most consequential architectural choice is rarely the framework or the mesh; it is whether each service owns its data. Fowler's "decentralized control of languages and data" is a real characteristic, but it comes with a cost that teams often discover late.

Consider two services: orders and inventory. If they share a database, a single transaction can reserve stock and create an order atomically. That is simple, and it couples the two services at the storage layer: a schema change requires coordination, and neither can be deployed or scaled independently without considering the other.

If each owns its data, the order service must ask inventory to reserve stock, and the request can fail after the order record is created. The saga pattern handles this with a compensating action, but the application now has to define what "cancelled" means, how long a reservation lasts, and what happens if the compensation itself fails. These are business rules that the shared database made implicit.

The decision therefore turns on a question about the domain, not technology: are these two capabilities genuinely independent, with separate owners and separate scaling needs? If not, a shared database with clear module boundaries is a reasonable choice, and calling the result "not a microservice" is a semantic objection rather than an engineering argument.

What the pattern literature does not solve

Three limits are worth stating plainly.

Events do not remove coupling. They change its form. A consumer that depends on the exact shape of a producer's event is coupled to that producer, and a schema change becomes a distributed migration. Contract discipline is still required.

Sagas are not transactions. A compensation is a new action, not an undo. If the compensating action fails, the system is in an intermediate state that needs a human or a retry policy. The design question is what state is acceptable during a failure, not whether failure can be eliminated.

The monolith is a legitimate comparator. Fowler's article is a description of a style, not a recommendation that every system adopt it. A well-structured monolith can have independent modules and clear boundaries; the decision to distribute should be driven by a real need for independent deployment or scaling, not by fashion.

A decision test

  1. Identify why you need independent deployment or scaling before splitting a system.
  2. Draw the call chain and count hops and failure points, as in the worked example.
  3. Choose synchronous calls only where an immediate answer is genuinely required; Fowler's warning is worth taking literally.
  4. Use events for decoupling, with explicit schema ownership and delivery monitoring.
  5. Design compensations for every saga step and define the acceptable intermediate state.
  6. Adopt a service mesh only when the cross-cutting concerns are real and repeated.
  7. Compare against a modular monolith and state what distribution buys you.

For the operational prerequisites, see Observability and DevOps.

A counterargument

Its arithmetic is the article's soft spot: it admits the 20 ms hops and 0.5% failure rates are hypothetical, yet the case against splitting rests on them. A reasonable critic would note that a monolith has internal dependencies and database calls that fail too, so counting network hops overstates the reliability gap, and that independent deployment's real payoff is organisational - team autonomy and release cadence - which a hop-counting method cannot price. The article concedes that Fowler's piece is a description, not a recommendation, and that a modular monolith is legitimate, but its decision test enumerates only the costs of distribution - pipelines, dashboards, compensations - and never quantifies the benefit that would justify them.

The objection is that a framework measuring only one side of the ledger will favour the status quo.

References & Further Reading