---
title: "Read changes from the database log · Agent Wranglers"
url: https://agentwranglers.se/playbook/data-engineering/loading-and-change-data-capture/log-based-cdc
id: DEN-10
level: Recommended
updated: 2026-10-22
tokens: 726
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 [Loading and change data capture](https://agentwranglers.se/playbook/data-engineering/loading-and-change-data-capture.md).

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

- ID: DEN-10
- Level: Recommended
- Chapter: [Loading and change data capture](https://agentwranglers.se/playbook/data-engineering/loading-and-change-data-capture.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/data/transactions-and-concurrency/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/data-engineering/loading-and-change-data-capture/source-schema-contracts.md).

## Sources

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

## Related rules

- DAT-18 [Send side effects through an outbox](https://agentwranglers.se/playbook/data/transactions-and-concurrency/outbox.md) in Data and databases
- DEN-12 [Treat each source schema as a contract](https://agentwranglers.se/playbook/data-engineering/loading-and-change-data-capture/source-schema-contracts.md) in Data engineering

**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/data-engineering/loading-and-change-data-capture/log-based-cdc">Agent Wranglers data engineering playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Carry deletes into the warehouse](https://agentwranglers.se/playbook/data-engineering/loading-and-change-data-capture/propagate-deletes.md)
- Next: [Cap and watch replication slots](https://agentwranglers.se/playbook/data-engineering/loading-and-change-data-capture/replication-slot-limits.md)
- [Loading and change data capture](https://agentwranglers.se/playbook/data-engineering/loading-and-change-data-capture.md)
