liveBook · Manning

Distributed transaction

A distributed transaction is a unit of work involving multiple independent resources or systems whose outcome is coordinated as a single transaction.

How 5 Manning books explain it

Microservices Patterns, Second Edition

A transaction identified and coordinated across multiple participating resource managers.

How it is used
Uses distributed ACID transactions to maintain consistency across multiple services, databases, or message brokers.
How deep it goes
Details XA participation and two-phase commit, then focuses on why the approach poorly fits microservices.
Examples
Uses a createOrder command spanning the Order Service and Customer Service to illustrate shared transaction participation.
What you can do after
Evaluate why classic distributed transactions are a poor fit for microservices and why Sagas are preferred.

Read how Microservices Patterns, Second Edition explains distributed transaction →

Kafka for Architects

A distributed transaction is a transaction whose operations span multiple independent systems or databases and must satisfy a coordinated all-or-nothing outcome.

How it is used
Frames database-and-Kafka workflows where coordinated all-or-nothing outcomes are required.
How deep it goes
Defines distributed transactions, explains 2PC phases and failure modes, and points to the transactional outbox without detailing its full implementation.
Examples
Uses profile updates, Kafka notifications, database writes, offset commits, and a transactional-outbox publishing process.
What you can do after
Apply the transactional outbox pattern to address database-and-Kafka dual writes when 2PC is unavailable.

Read how Kafka for Architects explains distributed transaction →

Think Distributed Systems

A distributed transaction is a transaction whose participants are located across multiple components or stores and must reach a coordinated commit-or-abort outcome.

How it is used
Coordinates changes across multiple resource managers so they reach a unanimous commit-or-abort decision.
How deep it goes
Explains local and global states, safety, liveness, and atomic commit protocols, while focusing on atomicity rather than other ACID guarantees.
Examples
Uses a two-store money transfer, two key-value-store participants, transaction states, and a two-phase commit sequence.
What you can do after
Evaluate distributed transaction correctness by checking unanimous decisions for safety and eventual decisions for liveness.

Read how Think Distributed Systems explains distributed transaction →

MongoDB 8.0 in Action, Third Edition

A distributed transaction is a transaction whose operations involve multiple database resources or partitions and require coordinated commit or rollback.

How it is used
Coordinates atomic updates across documents, collections, databases, or shards when single-document modeling is insufficient.
How deep it goes
Explains Callback API execution, retries, deployment limits, forbidden operations, and cross-shard overhead without detailing transaction internals.
Examples
Demonstrates account, customer, and transaction updates through Node.js, with parallel implementations for PyMongo and Ruby.
What you can do after
Apply it via MongoDB driver Callback APIs with coordinated commit, rollback, and transient-error retry handling.

Read how MongoDB 8.0 in Action, Third Edition explains distributed transaction →

PostgreSQL Mistakes and How to Avoid Them

A distributed transaction is an atomic unit of work whose operations execute across multiple database nodes.

How it is used
Explains how applications preserve atomicity when one business operation reads or writes across database nodes.
How deep it goes
Defines the failure, demonstrates stale replica behavior, and introduces 2PC while deferring implementation detail.
Examples
Uses alpha and beta account reads, balance updates, and a stale standby to demonstrate an inconsistent cross-node operation.
What you can do after
Diagnose/debug with it by recognizing stale-replica decisions and evaluating whether 2PC costs are acceptable.

Read how PostgreSQL Mistakes and How to Avoid Them explains distributed transaction →

What to know first

Related concepts

Questions about distributed transaction

What is distributed transaction?

A distributed transaction is a unit of work involving multiple independent resources or systems whose outcome is coordinated as a single transaction.

Which Manning books explain distributed transaction?

Microservices Patterns, Second Edition, Kafka for Architects, Think Distributed Systems, MongoDB 8.0 in Action, Third Edition and PostgreSQL Mistakes and How to Avoid Them.

What should I know before learning distributed transaction?

Manning books that teach distributed transaction usually introduce consistency, database transaction, ACID and CAP theorem first.

What is the difference between distributed transaction and Apache Kafka?

A distributed transaction is a unit of work involving multiple independent resources or systems whose outcome is coordinated as a single transaction. Apache Kafka is a distributed event-streaming platform for publishing, storing, and processing streams of records.

What is distributed transaction a kind of?

Distributed transaction is a kind of database transaction. A database transaction is a bounded unit of database operations whose changes are treated as one logical whole, typically committed or rolled back together.

What are the parts of distributed transaction?

Distributed transaction includes nondistributed transaction.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.