Distributed transactions

Keeping data consistent across several databases or services. Options range from two-phase commit and consensus-based SQL to sagas and the outbox pattern, trading simplicity, latency and availability.

Where it shows up in real systems

  • Distributed SQL

    Each write is committed through a consensus protocol (Raft or Paxos), so it is never lost and every read is up to date, even across regions. The price is latency: a write must reach a majority of replicas, and across regions that means tens of milliseconds.

    In production: Google Cloud Spanner, CockroachDB, YugabyteDB, TiDB, Amazon Aurora DSQL

  • Workflow orchestrator

    Each step is persisted, so a crash resumes where it stopped. Sagas use compensating steps, such as refunding a payment, instead of a distributed transaction.

    In production: Temporal, AWS Step Functions, Azure Durable Functions, Camunda

See it break, then fix it

Build an architecture, send it a day of traffic and outages, and learn why it holds or fails. Free to start.