What Is Change Data Capture (CDC)? Everything You Need to Know
PostgreSQL CDC can be implemented three ways: logical replication (built-in), Debezium (via Kafka Connect), or RisingWave native CDC (direct, no middleware). Each has different complexity, latency, and feature trade-offs.
Comparison
| Approach | Middleware | Processing | Serving | Complexity |
| Logical replication | None | ❌ (replication only) | ❌ | Low |
| Debezium + Kafka | Kafka Connect, Kafka | Via consumer (Flink, etc.) | External DB | High |
| RisingWave native | None | ✅ SQL (materialized views) | ✅ PG protocol | Low |
PostgreSQL Logical Replication
Built into PostgreSQL. Replicates tables to another PostgreSQL instance.
-- On publisher
CREATE PUBLICATION my_pub FOR TABLE orders, customers;
-- On subscriber
CREATE SUBSCRIPTION my_sub CONNECTION '...' PUBLICATION my_pub;
Limitation: Replication only — no transformation, no aggregation, no non-PostgreSQL destinations.
RisingWave Native CDC
Direct PostgreSQL-to-RisingWave streaming with SQL processing:
CREATE SOURCE pg_source WITH (connector='postgres-cdc', hostname='pg-host', port='5432', ...);
CREATE TABLE orders (...) FROM pg_source TABLE 'public.orders';
CREATE MATERIALIZED VIEW order_metrics AS SELECT status, COUNT(*), SUM(amount) FROM orders GROUP BY status;
One system, no middleware. Query results directly via PostgreSQL protocol.
Frequently Asked Questions
Which PostgreSQL CDC method is simplest?
RisingWave native CDC is simplest for real-time analytics — no Kafka, no Debezium, SQL-only. Logical replication is simplest for database-to-database replication. Debezium is most flexible for multi-consumer architectures.
Does PostgreSQL CDC affect performance?
Log-based CDC reads the WAL, which PostgreSQL already writes. Impact is minimal — typically <5% additional load on the source database.

