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:

  1. Transaction Log: The database maintains a log of all transactions. This log is used as the source of truth for all changes.
  2. Log Tailing: A component tails the transaction log and publishes changes to a message broker or event stream.
  3. Event Stream: Microservices subscribe to the event stream to receive updates.
  4. Consistency: Ensures eventual consistency across different microservices by propagating changes through the event stream.
  5. Decoupling: Reduces direct dependencies between microservices by using the transaction log as an intermediary.

References:

Acceptance Criteria:

  1. Implement a component that tails the transaction log of a database and publishes changes to an event stream.
  2. Develop microservices that subscribe to the event stream and update their state based on the received events.
  3. Ensure eventual consistency across all microservices by validating that updates are correctly propagated and handled.

Source: iluwatar/java-design-patterns