# Transaction Log Tailing

> Tap directly into the DB transaction log to publish events — zero application-level overhead.

- **Category**: Microservices
- **Subcategory**: Messaging & Events
- **Canonical URL**: https://designpattern.fyi/patterns/transaction_log_tailing/

---

## Description
Clean, reusable architecture pattern.


## Use Cases
Order Service commits OrderPlaced to outbox table. Debezium detects the WAL entry within milliseconds and publishes to Kafka. Near real-time event propagation, zero impact on Order Service code or performance.





## Trade-offs


### Advantages

- Near real-time event publishing — millisecond lag vs seconds for polling

- Zero application code changes needed

- No additional DB load from polling queries

- Captures all changes — can't miss events due to app crashes




### Considerations & Drawbacks

- Requires DB-level access and configuration (replication slots, binlog)

- Debezium is powerful but complex to operate and scale

- Tied to specific DB internals — harder to switch DB engines

- WAL can grow large if consumer lags — needs monitoring







---
**Reference**: [Original Source](https://microservices.io/patterns/data/transaction-log-tailing.html)

