Event-driven architectures using Neon and Sequin
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.
Related posts
- 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.
- 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 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.
- 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.
- 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.