Transactional Consistency in a Global Hybrid World

BrainBlog Post for Fiorano

This new blog post revisits the international payment processing example from the previous blog post to add transactions to each step in the flow (see diagram) to explain how to ensure data consistency.

Here’s a summary…

Event-driven microservices are a good fit for many business models, such as payment processing, inventory tracking, and insurance claim processing.

An event processing flow hands off event data from one microservice to the next, typically using a messaging system. The microservice processes the input event data, and sends an event message containing the output event data to the next microservice in the flow, which processes the event data, and so on until flow completion.

This is all fine of course until either an event message isn’t delivered because of a network issue or a microservice fails due to a hardware or resource issue. What happens then?

Preserving transactional consistency is of course essential to ensuring the data in the virtual world (i.e. the IT system) is consistent with the data in the physical world (e.g. inventory count of an item in a warehouse is consistent with the inventory count in the inventory database).

Otherwise a business can’t rely on it’s IT systems. IT system failures (in the event driven microservice flow in this case) therefore can’t result in a lost record of an item sale or lost debit or credit for a bank payment.

The answer is twofold: Use transactions for reading and writing event message data to and from the queues (or topics) to protect against potential loss of event data.

And define a SAGA framework that includes a compensation action for each step in the flow to restart the flow in the case of catastrophic failure.

Click here to read the entire post

SHARE THIS: