---
title: "Event-driven architectures using Neon and Sequin"
description: "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."
url: "https://swe.quest/articles/event-driven-architectures-using-neon-and-sequin-8e1877ce94623987"
canonical: "https://neon.com/blog/event-driven-architectures-using-neon-and-sequin"
source: "Neon"
published: "2024-10-22"
difficulty: "medium"
kind: "How-to"
reading_minutes: 5
tags: ["event-driven","postgres","replication"]
---

# Event-driven architectures using Neon and Sequin

A post on [Neon](https://swe.quest/sources/neon.md), published 2024-10-22, 5 min read, How-to. Original: [https://neon.com/blog/event-driven-architectures-using-neon-and-sequin](https://neon.com/blog/event-driven-architectures-using-neon-and-sequin)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Event-driven architecture](https://swe.quest/tags/event-driven.md) (Backend & APIs)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Replication](https://swe.quest/tags/replication.md) (Distributed systems)

## Prerequisites

- PostgreSQL logical replication ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- change data capture basics

## Keywords

Neon, Sequin, Debezium, Kafka, pgoutput, logical replication

## Related posts

- [Fan-out from Postgres with Change Data Capture using Debezium and Upstash Redis](https://swe.quest/articles/fan-out-from-postgres-with-change-data-capture-using-debezium-and-upstash-redis-1afcb52ed56a9566.md): Neon · 2024-02-14 · Medium · 9 min read · Event-driven architecture, PostgreSQL, Queues & messaging, Replication
  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.
- [Stream data from Neon to external data sources via logical replication](https://swe.quest/articles/stream-data-from-neon-to-external-data-sources-via-logical-replication-ba0a37ed2d47496f.md): Neon · 2024-08-09 · Medium · 7 min read · PostgreSQL, Replication, Event-driven architecture, Data pipelines
  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.
- [Change Data Capture with Serverless Postgres](https://swe.quest/articles/change-data-capture-with-serverless-postgres-4d667a8d26488042.md): Neon · 2023-12-21 · Medium · 7 min read · PostgreSQL, Replication, Event-driven architecture, Serverless
  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.
- [Postgres Meets Analytics: CDC From Neon to ClickHouse Via PeerDB](https://swe.quest/articles/postgres-meets-analytics-cdc-from-neon-to-clickhouse-via-peerdb-669fe8e963909dd5.md): Neon · 2024-10-02 · Medium · 5 min read · PostgreSQL, Event-driven architecture, Analytics & OLAP, Replication, Data pipelines
  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.
- [Change Data Capture with Neon and Materialize](https://swe.quest/articles/change-data-capture-with-neon-and-materialize-b7e8c6b1f01b6525.md): Neon · 2023-12-21 · Medium · 4 min read · Event-driven architecture, PostgreSQL, Replication, Stream processing
  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.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
