Change Data Capture with Neon and Materialize
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.
Related posts
- Change Data Capture with Serverless Postgres
Neon mediumAdept
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.
- 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.
- 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.
- Build a Real-time Materialized View from Postgres Changes using Confluent’s ksqlDB
Neon mediumAdept
Postgres logical replication can feed a Debezium-based CDC connector on Confluent Cloud that streams changes from Neon tables into Kafka topics, where ksqlDB aggregates them into a continuously updated materialized view. The walkthrough builds a player leaderboard: create a publication and pgoutput replication slot, configure the Postgres CDC Source connector with JSON_SR schemas, import topics as ksqlDB streams, and define a SUM aggregation table with EMIT CHANGES. Compared with Postgres REFRESH MATERIALIZED VIEW, this approach avoids repeated refresh costs, retains history in Kafka, and pushes updates to subscribers via the ksqlDB REST API.
- Event-driven architectures using Neon and Sequin
Neon mediumAdept
Sequin offers a lighter alternative to Debezium plus Kafka for change data capture on Neon Postgres, using a logical replication slot to build a strictly ordered "Sequence" of table rows that consumers can read, rewind and replay without copying data into a separate system. Setup covers enabling logical replication in Neon, creating a pgoutput replication slot and a publication, defining a Sequence with a sort column, and creating a pull consumer group with optional SQL filters and a chosen start position. Consumers fetch batches over an HTTP receive endpoint and acknowledge them with ack tokens, and Sequin redelivers rows until they are acknowledged.