System Design ($200k+) · STORAGE · Distributed Systems Core · 2026

Log-Based CDC (Debezium WAL) vs Periodic SQL Table Polling

Quick Decision Rule: When Syncing millions of Postgres mutations—including hard `DELETE`s—to Elasticsearch and Kafka with sub-second latency and minimal DB CPU impact, choose Log-based Change Data Capture (Debezium reading Postgres WAL / MySQL binlog) capturing inserts, updates, and hard deletes with near-zero query overhead.

Trigger ConditionSyncing millions of Postgres mutations—including hard `DELETE`s—to Elasticsearch and Kafka with sub-second latency and minimal DB CPU impact
Recommended ChoiceLog-based Change Data Capture (Debezium reading Postgres WAL / MySQL binlog) capturing inserts, updates, and hard deletes with near-zero query overhead
Classic TrapPolling `WHERE updated_at > ?` hammers primary DB indexes, misses hard `DELETE` rows completely, and drops concurrent in-flight transaction timestamps.
VerificationAudited on 2026-11-23 · Distributed Systems Core · 2026

30-SECOND DECISION TRAP CHECK · STORAGE

Test your instinct

A sync worker polls PostgreSQL every 5 seconds (`SELECT * FROM products WHERE updated_at > $last`) to update Elasticsearch. Customers complain deleted products still appear in search forever and primary DB CPU spiked 35%. Best replacement?

Primary Engineering Documentation

Related Storage Decision Guides