---
title: "Read changes from the database log · Agent Wranglers"
url: https://agentwranglers.se/playbook/events/publishing-events/log-based-cdc
id: EVT-7
level: Recommended
updated: 2026-10-27
build: a2a6bdfed830
tokens: 708
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Read changes from the database log

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Publishing events](https://agentwranglers.se/playbook/events/publishing-events.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-27.

- ID: EVT-7
- Level: Recommended
- Chapter: [Publishing events](https://agentwranglers.se/playbook/events/publishing-events.md)
- Rule: For tables that change often or must reach the warehouse within 15 minutes, read changes from the database's write-ahead log or binlog. Do not poll those tables with queries.
- Check: Insert, update and delete a test row. All three changes reach the warehouse within 15 minutes, in commit order, each with its commit time.
- How: Log-based change data capture sees every insert, update and delete in commit order, and adds no query load on the tables. A tool such as Debezium reads PostgreSQL logical replication or the MySQL binlog. For facts the app publishes, such as an order placed, write them through [Send side effects through an outbox](https://agentwranglers.se/playbook/events/publishing-events/outbox.md) and capture the outbox table. Then the warehouse gets business facts, not internal column changes. Source schema changes reach the stream too, so follow [Treat each source schema as a contract](https://agentwranglers.se/playbook/events/contracts-and-schemas/source-schema-contracts.md).

## Sources

- [PostgreSQL Logical decoding concepts](https://www.postgresql.org/docs/current/logicaldecoding-explanation.html)

## Related rules

- STK-106 [Use ClickHouse when analytics outgrow PostgreSQL](https://agentwranglers.se/playbook/stack/databases-and-storage/analytics-database.md) in Software choices
- EVT-6 [Send side effects through an outbox](https://agentwranglers.se/playbook/events/publishing-events/outbox.md) in Integration and events
- EVT-5 [Treat each source schema as a contract](https://agentwranglers.se/playbook/events/contracts-and-schemas/source-schema-contracts.md) in Integration and events

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/events/publishing-events/log-based-cdc">Agent Wranglers integration and events playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Send side effects through an outbox](https://agentwranglers.se/playbook/events/publishing-events/outbox.md)
- Next: [Cap and watch replication slots](https://agentwranglers.se/playbook/events/publishing-events/replication-slot-limits.md)
- [Publishing events](https://agentwranglers.se/playbook/events/publishing-events.md)
