Microservice pattern: Transaction log tailing
Author: iluwatarCreated Oct 15, 2023Updated Aug 16, 2026
Labelsinfo: help wantedepic: patterntype: feature
Description: The Microservices - Transaction Log Tailing design pattern focuses on maintaining a consistent and up-to-date data view across different microservices by tailing the transaction log of a database. This pattern is particularly useful in scenarios where multiple microservices need to respond to changes in a shared database in real-time. It ensures that all services are notified of changes and can react accordingly without direct coupling.
Main Elements:
- Transaction Log: The database maintains a log of all transactions. This log is used as the source of truth for all changes.
- Log Tailing: A component tails the transaction log and publishes changes to a message broker or event stream.
- Event Stream: Microservices subscribe to the event stream to receive updates.
- Consistency: Ensures eventual consistency across different microservices by propagating changes through the event stream.
- Decoupling: Reduces direct dependencies between microservices by using the transaction log as an intermediary.
References:
- Microservices Pattern: Transaction Log Tailing
- Martin Fowler - Event-Driven Architecture
- Project Contribution Guidelines
Acceptance Criteria:
- Implement a component that tails the transaction log of a database and publishes changes to an event stream.
- Develop microservices that subscribe to the event stream and update their state based on the received events.
- Ensure eventual consistency across all microservices by validating that updates are correctly propagated and handled.
Source: iluwatar/java-design-patterns