Posts

Showing posts with the label distributed business transactions

Transactional Event-Sourced Workflows

Image
Distributed Transactions (updating multiple transactional resources simultaneously) are among the hardest problems in Distributed Systems. A process updates the state of the component, then has to tell the rest of the system about it - and those two actions aren't atomic. The update lands, but the notification is lost, or the notification fires but the update is never committed.  Let’s see how Event-Sourced Workflows can address the issue by introducing transactionality between updating a workflow's progress and updating the state of the command model (which inherently notifies the world of the change). Firstly, we are going to define what Event Sourcing and Workflows are, and, finally, how they intersect. What Event Sourcing is Event Sourcing stores the full sequence of events that led to the current state needed to make the decision, rather than storing the state and overwriting it with every change. The event store (an append-only log) represents the source of truth, and t...

Myths about Distributed Business Transactions

Image
Nowadays, most systems are distributed in one way or the other - just accessing a database via HTTP makes the system distributed. Not so rarely, there is a message broker in the mix which makes a good soil for Distributed Business Transactions. There is a lot of mystery about them, they get confused with ACID transactions easily. I'm going to address common myths and misunderstandings about Distributed Business Transactions and provide some options on how to handle multiple independent resources. Before we start, let's try to understand what a Distributed Business Transaction is. Distributed Business Transactions Distributed Business Transaction is a business transaction that spans at least two independent  transactional resources.  One example would be a database update and sending a message via a message broker (see Diagram 1 ). Those two resources have their own transaction management and are completely independent. Another example would be updating two different files on a...