Building Event-Driven Systems with PostgreSQL Logical Replication and Drasi | POSETTE 2026
Diaa Radwan explains how to build event-driven architectures directly on PostgreSQL using logical replication and change data capture, and compares three CDC approaches (wal2json, Debezium+Kafka, and Drasi) using live benchmarks for overhead, latency, and implementation complexity.
Overview
The talk focuses on using PostgreSQL logical replication (via the write-ahead log) as the foundation for event streams, instead of relying exclusively on external streaming platforms.
Why CDC via PostgreSQL logical replication
Diaa Radwan frames logical replication as a way to capture database changes in real time and use them as an event stream.
Key problems this approach aims to avoid:
- Polling-based approaches
- Triggers used as event emitters
- Dual writes (writing to the database and a separate event system)
Three CDC approaches compared
The session compares three ways to turn PostgreSQL changes into downstream events:
1) wal2json with custom consumers
- Uses
wal2jsonto transform WAL changes into JSON - Requires building and operating custom consumers
- Demonstrated as a low-latency streaming option
2) Debezium with Kafka
- Uses Debezium for CDC capture
- Uses Kafka as the streaming/event backbone
- Discusses trade-offs in complexity and operational overhead
3) Drasi with PostgreSQL
- Uses Drasi (a CNCF Sandbox project) on top of PostgreSQL CDC
- Adds continuous queries and filtering on top of the change stream
- Demonstrates filtering and fan-out using declarative queries
Architecture and pipeline walkthrough
The talk includes an explanation of the WAL pipeline and how changes flow from PostgreSQL into each of the three CDC paths.
Benchmarking: latency, overhead, and complexity
Diaa Radwan walks through live benchmarks intended to compare the approaches fairly, including:
- Database overhead
- End-to-end latency
- Lines of code required (as a proxy for implementation complexity)
During the demos, PostgreSQL CPU and network usage are monitored to show the runtime impact.
Production considerations and risks
The session calls out operational risks and configuration details that matter in production:
- How to configure replication slots and publications
- How to avoid WAL accumulation issues (WAL growth) related to slots
- How to decide when logical replication is a good fit for the architecture
Video chapters
- 00:00 – Music & introduction
- 00:21 – Three approaches to event streams
- 00:50 – Problems with polling, triggers, and dual writes
- 01:41 – CDC with WAL: the core idea
- 02:16 – Inside the WAL pipeline explained
- 03:05 – Setting up logical replication in Postgres
- 04:07 – Architecture overview: three CDC paths
- 06:01 – Benchmark setup for fair comparison
- 07:52 – Demo: wal2json low-latency streaming
- 11:14 – Demo: Debezium and Kafka trade-offs
- 16:18 – Demo: Drasi filtering and fan-out
- 22:03 – Comparing latency, cost, and complexity
- 24:13 – Production risks: WAL growth and slots
- 25:49 – Choosing the right CDC approach
Links
- POSETTE: An Event for Postgres: https://posetteconf.com
- POSETTE playlist: https://aka.ms/posette-playlist