distributed transaction patterns.pdf
distributed transaction patterns.pdf
Transaction Patterns:
(1/10)
Introduction
Distributed transactions span
multiple processes across different
machines.
Ensuring no partial work is
completed by one process without
the other.
Different solutions are available
based on system requirements.
This presentation explores three
common solutions.
(2/10)
Challenges in Distributed
Transactions
Ensuring atomicity across
distributed processes.
Avoiding partial failures in
interconnected systems.
Balancing reliability,
performance, and complexity.
Solutions depend on
communication methods (e.g.,
HTTP, JMS).
(3/10)
Solution 1 – Request/Reply
with Transaction
Propagation
Use case: HTTP/REST or SOAP web
services
A starts a transaction before calling B.
A propagates the transaction to B via
remote call.
B imports and processes the transaction.
B terminates and returns an extent to A.
A adds the extent and commits/rolls back
the transaction.
(4/10)
Solution 2 – JMS with XA
Drivers
Use case: Reliable asynchronous
messaging with guaranteed delivery
A starts a transaction and sends a JMS
message using XA drivers.
A commits the transaction which triggers
sending.
B receives message, starts transaction.
B processes the message and commits
the transaction.
(6/10)
Comparison of the
Solutions
Request/Reply Use Case:
Propagation HTTP/REST/SOAP Calls
Key Benefit:
Synchronous atomicity
Complexity: Low
(7/10)
Comparison of the
Solutions
JMS with Use Case: Asynchronous
Transaction messaging
Key Benefit:
Propagation
Propagated consistency
Complexity: Medium
(8/10)
Choosing the Right
Solution
Request/Reply: Best for real-
time synchronous transactions.
JMS with XA: Use when
guaranteed delivery is critical.
JMS with Propagation:
Suitable for message-driven
services.
(9/10)
Try for Yourself
(10/10)