</> MAANG.io
system design · 201

Intermediate

Master system design interviews with scalable architecture patterns, distributed systems, and real-world design challenges.

0/124 solved 0% complete

Distributed Transactions

maang.io System Design Series


A distributed transaction must be all-or-nothing across multiple databases or services. The classic answer, two-phase commit (2PC), coordinates a prepare-then-commit handshake — but a crashed coordinator can leave participants blocked, holding locks. That failure mode is why scalable systems often prefer the Saga pattern (chained local transactions with compensations) and TCC instead.

This deep dive comes in three parts:

  • Foundations & Core Concepts — atomic commit, 2PC, and the coordinator-blocking problem.
  • Internals — 3PC, Saga (orchestration vs choreography), TCC, and the transactional outbox, with worked numbers.
  • Interview — Staff/Principal Q&A: 2PC vs Saga, idempotency, and failure handling.

Sign in to MAANG.io

Use your Google or Microsoft account — no password to remember.

Continue with Google Continue with Microsoft

Please accept the terms above to continue.