- How to update the database and publish a message (event) atomically (either all success, or all fail).
- Cannot use distributed transaction pattens to solve this problem.
- Many modern message brokers don’t support distributed transactions.
- Publish messages by tailing the database’s transaction log.
- A transaction log miner reads the transaction log and publish each change as a message to the message broker.
- Requires database specific solutions.
- It can be difficult to reverse engineer the high‑level business events from the low‑level updates recorded in the transaction log.
- The atomicity of updating the database and publishing a message (event) is guaranteed.
- Requires database specific solutions.
Topic | Consideration | Possible Solution Options |
---|
- Book: Chris R.(2018). Chapter 3. Interprocess communication in a microservice architecture, Microservices Patterns (pp. 65-109). Manning Publications
- Book: Kasun I., Prabath S.(2018). Chapter 5: Data Management, Microservices for the Enterprise (pp. 125-150). Apress
- Web Article: Pattern: Transaction log tailing | https://microservices.io/patterns/data/transaction-log-tailing.html
- Web Article: Event-Driven Data Management for Microservices | https://www.nginx.com/blog/event-driven-data-management-microservices/