Brain-Score 94/100 TECH Hello Interview · 14:42

Distributed Transactions Explained: 2 Phase Commit vs Saga Pattern

3-Second Blueprint (English)

  1. Splitting orders across payment, inventory, and ledger microservices breaks single-database ACID atomicity and isolation.
  2. Two-Phase Commit holds row locks across prepare and commit phases, moving at the slowest node's speed and stalling on crashes.
  3. Production systems favor orchestrated Sagas with idempotent retries, visible compensations (like refunds), and a transactional outbox.
Two-Phase Commit (2PC)Saga PatternOrchestration vs ChoreographyCompensating TransactionsTransactional OutboxIdempotent Retries

3-Sekunden-Fazit (Deutsch)

  1. Die Aufteilung auf Zahlungs-, Bestands- und Buchhaltungs-Services bricht die lokale ACID-Atomarität und -Isolation einer Datenbank.
  2. Two-Phase Commit hält Zeilensperren über Prepare- und Commit-Phasen, bremst auf den langsamsten Dienst ab und blockiert bei Abstürzen.
  3. Produktivsysteme nutzen orchestrierte Sagas mit idempotenten Retries, Kompensationsaktionen (wie Rückbuchungen) und Transactional Outbox.
Two-Phase Commit (2PC)Saga-PatternOrchestrierung vs. ChoreografieKompensationstransaktionenTransactional OutboxIdempotente Retries

Note / Hinweis: Blueprints are AI-generated educational summaries (0% Politics · 0% Religion · 0% Brainrot) and do not constitute medical, legal, or financial advice. / KI-generierte Zusammenfassung zu Bildungszwecken – ersetzt keine medizinische, rechtliche oder finanzielle Fachberatung.