Change Data Capture with Serverless Postgres
Neon has released Postgres logical replication in beta, letting Neon databases act as publishers that stream an initial snapshot plus row-level changes to external stores for change data capture and real-time analytics. Under the hood, the walsender decodes the WAL through an output plugin: pgoutput for Postgres-to-Postgres replication, and newly supported wal2json for systems such as Kafka or Materialize. Enabling it is irreversible and restarts the compute. Neon can't act as a subscriber yet, active subscribers can prevent scale-to-zero, DDL changes are not replicated, and replication lag should be monitored.
Related posts
- Stream data from Neon to external data sources via logical replication
Neon mediumAdept
Neon now supports outbound Postgres logical replication in beta, letting a Neon database publish WAL-decoded inserts, updates and deletes to warehouses, Kafka, CDC tools and other Postgres databases; inbound replication is coming later. Logical replication covers data changes only, not DDL, so schema changes must be applied to subscribers by hand. It uses publications, decoder plugins like pgoutput, and replication slots that retain WAL until subscribers consume it. In Neon, enabling it restarts all computes, only roles created via Console/CLI/API carry the REPLICATION privilege, and inactive slots are dropped after 75 minutes when other active slots exist. Setup guides cover Airbyte, Fivetran, Confluent, Materialize, Decodable, Bemi, DoubleCloud and Sequin.
- Change Data Capture with Neon and Materialize
Neon mediumAdept
Neon's logical replication support lets Materialize ingest Postgres changes directly via the native replication protocol, without Debezium or other extra infrastructure, while keeping transactional consistency. The setup has a few steps on the Neon side: enable logical replication (irreversible, and it restarts compute endpoints), create a replication user with grants, set REPLICA IDENTITY FULL on each table, and create a publication. In Materialize you then create a secret, a Postgres connection and a source. The source snapshots existing data into subsources, then streams changes into incrementally maintained SQL views such as a live row count.
- Postgres Meets Analytics: CDC From Neon to ClickHouse Via PeerDB
Neon mediumAdept
Neon serverless Postgres can serve as the transactional system of record while ClickHouse handles real-time analytics, with PeerDB streaming changes between them via Postgres logical replication. Setup involves creating a replication-capable user and a publication in Neon, enabling logical replication (wal_level=logical), creating a destination database and a user with insert/alter grants in ClickHouse, then defining peers and a CDC mirror in PeerDB with an initial snapshot and table selection. PeerDB, now owned by ClickHouse, is slated to power the Postgres CDC connector in ClickPipes.
- A Guide to Logical Replication and CDC in PostgreSQL with Airbyte
Neon mediumAdept
PostgreSQL logical replication builds on the write-ahead log: logical decoding turns byte-level WAL records into row-level INSERT/UPDATE/DELETE changes, and replication slots track each subscriber's LSN while retaining WAL until it is consumed. Unlike physical replication, logical replication can filter tables, rows and columns but does not replicate schema or DDL, so additive schema changes should be applied to subscribers first. Postgres-to-Postgres setup uses wal_level=logical, a replication role, publications and subscriptions, while Airbyte's CDC connector moves data into warehouses such as BigQuery or Snowflake, including from Neon. Tuning wal_compression, max_wal_size and min_wal_size helps limit WAL buildup between syncs.
- Fan-out from Postgres with Change Data Capture using Debezium and Upstash Redis
Neon mediumAdept
Streaming committed Postgres changes from the write-ahead log via a logical replication slot avoids the dual-write problem, where an application writes to the database and a message broker separately and can leave them inconsistent. LISTEN/NOTIFY doesn't fix this because it is only at-most-once. The guide configures Debezium Server to read Neon's WAL using pgoutput, with an initial snapshot and file-based offset tracking, and to sink change events into an Upstash Redis stream. A Node.js consumer then uses XREADGROUP consumer groups and XACK to get at-least-once fan-out that can resume after restarts.