☕🔗 DISTRIBUTED TRANSACTIONS: 🔟 Lessons from Guy Pardon & Josh Long
☕🔗 DISTRIBUTED TRANSACTIONS: 🔟 Lessons from Guy Pardon & Josh Long
One failed commit can corrupt an entire business workflow.
🔸 TL;DR
Java Champion Josh Long interviews Guy Pardon, founder of Atomikos (2001), a Java distributed transaction manager.
Atomikos coordinates transactions across XA-capable databases and messaging systems, without requiring a traditional application server.
(💡XA (eXtended Architecture) is a standard for coordinating distributed transactions across databases and messaging systems using Two-Phase Commit (2PC) to ensure consistency.)

Here are 🔟 verbatim insights from their discussion:
1️⃣ [You can't rely on commit ordering because you can always find a scenario where it fails.]
A JDBC commit followed by a JMS send is not automatically atomic. A failure between them can leave inconsistent data.
(💡Commit ordering is the practice of committing transactions across multiple resources sequentially. It risks data inconsistency if one commit succeeds but a subsequent one fails.)
#Consistency
2️⃣ [But once it's prepared, it's going forward to commit.]
With two-phase commit (2PC), the coordinator commits after all participants prepare successfully. A failed prepare can trigger rollback.
(💡Two-Phase Commit (2PC) is a distributed transaction protocol where a coordinator first asks all resources to prepare, then commits if all agree, or rolls back if any fails.)
#TwoPhaseCommit
3️⃣ [if nobody recovers a prepared transaction, it keeps its locks]
Prepared transactions may hold locks until recovery completes. Reliability also depends on operational recovery.
(💡Prepare transaction is the first phase of Two-Phase Commit (2PC), where each resource confirms it can commit, persists the required state, and holds locks while awaiting the final decision.)
#Recovery
4️⃣ [But if you send out money, bother.]
Not every notification needs a distributed transaction. Financial transfers demand stronger consistency guarantees.
#FinTech
5️⃣ [And insurance companies like claims data, you know, a picture of an accident or something that's used as evidence for the claim. They don't want to lose it.]
Claims evidence has real financial value. Losing a record or message can undermine an insurance decision.
#InsuranceTech
6️⃣ [You're writing your own rollbacks, basically.]
Sagas require compensating business actions. That flexibility comes with implementation and maintenance costs.
(💡Sagas coordinate transactions across services. If a step fails, they can undo all or some earlier steps, like refunding a $200 debit after a failed transfer, without using Two-Phase Commit (2PC).)
#SagaPattern
7️⃣ [If you have long-running transactions, I can see the value of it.]
Guy sees Sagas as more compelling for long-running workflows or transactions spanning organizations.
(💡A long-running transaction is a business process spanning seconds, hours, or days across multiple steps or services, where failures may require undoing all or some completed steps using a Saga.)
#Microservices
8️⃣ [About Kafka, to make it consistent the way we do and the way XA does, they really need to have a two-phase commit implementation.]
Kafka's native transaction model does not automatically enlist with XA-coordinated JDBC/JMS resources.
#Kafka
9️⃣ [Well, as long as one node is up and running, it will recover everything also for the other nodes.]
Atomikos LogCloud stores shared transaction metadata, enabling recovery across application nodes.
#CloudNative
🔟 [So now it has Spring Boot 4 capabilities as well.]
Atomikos maintains a Spring Boot starter, including support for Spring Boot 4.
#SpringBoot
🔸 TAKEAWAYS
▪️ Use XA/2PC when partial success is unacceptable.
▪️ Plan recovery, not just the happy path.
▪️ Pick Sagas for the right workflow, not by default.
#Java #DistributedTransactions #Atomikos #SoftwareArchitecture
📘Fullstack Dev 2027 for Java Tech👉 https://a.co/d/0crUwEQ6