Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk4 min

Saga Pattern in Microservices: How It Works and When to Use It

A Saga coordinates service-owned transactions without a global database transaction. Learn how retries, compensation, choreography, and orchestration shape recovery.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A Saga coordinates a business workflow across services by splitting it into local transactions. Each service commits its own database change; events or commands move the workflow forward. If a later step cannot proceed, the system retries, continues forward, or runs business actions to compensate for earlier work. That compensation is not an ACID rollback: committed changes remain part of history, and their effects must be addressed explicitly.

How a Saga works

Suppose an order requires an order record, an inventory reservation, payment, and shipment. Each step is a transaction owned by a service, not one transaction spanning all the services. A successful step triggers the next one, often through a message or event. The workflow completes when its required steps finish.

As an Amazon Associate I earn from qualifying purchases.

If payment is declined after inventory has been reserved, the business rules may call for releasing that reservation and changing the order’s status. Those are new transactions with their own outcomes, not a reversal that erases the earlier commits. By contrast, a temporary service outage may call for retrying the payment step rather than compensating the inventory reservation. Choose recovery based on the failure and the business rules.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What consistency and recovery to expect

A Saga lets services coordinate changes in separately managed databases without requiring a global database transaction. It does not provide automatic rollback or ACID isolation across those databases. While the workflow is in progress, other parts of the system may observe intermediate states, and concurrent workflows may read stale data or overwrite one another’s updates.

Classify each step before implementation. Some completed actions can be compensated; others may be irreversible. A pivot is the point of no return in the workflow. Steps after that point may need to be retryable until completion, and retryable operations should be idempotent so repeated delivery does not duplicate a business effect. See Microsoft’s Saga guidance for these transaction roles.

Compensation is not guaranteed to succeed, either. Define what happens if a compensating action fails: whether it is retried, surfaced for investigation, or sent for manual recovery. The workflow needs a durable outcome that callers and operators can discover, including when recovery remains unresolved.

Choreography or orchestration?

These are coordination styles, not competing guarantees. Choreography lets participants react to events and publish events that trigger subsequent work. Orchestration assigns workflow state and next-step decisions to a coordinator that instructs participants.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Decision Choreography Orchestration
Who selects the next step? Participants respond to domain events; no central controller directs the sequence. A coordinator tracks workflow state and tells participants what operation to perform.
Good fit Relatively simple workflows with few participants. More complex workflows, more participants, or a need for centralized visibility and control.
Trade-off Control is distributed, but event dependencies can become hard to understand and test as steps grow; cyclic dependencies are possible. The flow is explicit and participant logic is separate from coordination, but the coordinator adds complexity and must be resilient.

Decide based on the workflow’s complexity, participant count, coupling, failure handling, visibility needs, and operational ownership—not a blanket preference for one style. Microsoft’s comparison of choreography and orchestration describes the same core trade-offs.

Design the workflow before choosing infrastructure

  1. Map local transactions. Name each service-owned change and the event or command that triggers the next step.
  2. Set recovery behavior per step. Record whether an action is compensable, irreversible, a pivot, or retryable. Describe compensation as a business effect, such as releasing inventory, not as a database rollback.
  3. Make repeat execution safe. Design participant operations to tolerate duplicate messages and retries, including after a transient failure or coordinator restart.
  4. Protect message delivery. A service can commit a database update but fail before publishing the corresponding event. Consider reliable write-and-publish approaches such as the transactional outbox; event sourcing may also be relevant to some designs. These are design patterns to evaluate, not automatic Saga features.
  5. Tell callers how to learn the outcome. A request may return a workflow identifier, with the caller polling for status or receiving a completion notification.
  6. Make failures diagnosable. Track workflow state and use logs, distributed traces, and correlation identifiers to locate the failed step and see whether retry, compensation, or manual recovery is underway.
  7. Protect business invariants under concurrency. Depending on the risk, use semantic locks, commutative updates, fresh reads, or version checks to prevent conflicting sagas from violating rules.
  8. Plan for incomplete recovery. Specify escalation and manual repair procedures for failed compensation or exhausted retries.

The Saga pattern reference at microservices.io discusses the lack of automatic rollback and isolation, as well as reliable messaging and caller-visible outcomes. AWS Prescriptive Guidance also covers idempotency, observability, and concurrency countermeasures.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

An orchestration example

AWS Prescriptive Guidance describes using AWS Step Functions to coordinate a Saga across databases, including order placement, inventory updates, and payment. In that example, failure recovery can include actions such as reverting an inventory update or removing an order. Step Functions is an AWS-specific option, not a requirement of the Saga pattern; the architectural distinction is that an orchestrator tracks the workflow and directs its participants.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.