One thing most customers want to know is how to coordinate writes to more than one system of record. Answering this question typically involves a long explanation of dual writes, distributed transactions, modern alternatives, and the possible failure scenarios and drawbacks of each approach. By Bilgin Ibryam.
The single indicator that you may have a dual write problem is the need to write to more than one system of record predictably. This requirement might not be obvious and it can express itself in different ways in the distributed systems design process.
The article then walks you through:
- The dual write problem
- The modular monolith
- Orchestration architecture
- Choreography pattern
- Parallel pipelines pattern
- How to choose a distributed transactions strategy
_Source @https://developers.redhat.com: https://developers.redhat.com/articles/2021/09/21/distributed-transaction-patterns-microservices-compared#the_modular_monolith_
Each pattern is explained from architecture, benefits and drawback points of view. In a sizable distributed system with tens of services, there won’t be a single approach that works for all, but a few of these combined and applied for different contexts. You might have a few services deployed on a shared runtime for exceptional requirements around data consistency. You might choose a two-phase commit for integration with a legacy system that supports JTA. You might orchestrate a complex business process, and also use choreography and parallel processing for the rest of the services. In the end, it doesn’t matter what strategy you pick; what matters is choosing a strategy deliberately for the right reasons, and executing it. Excellent read!
[Read More]