---
title: "Change Data Capture with Neon and Materialize"
description: "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."
url: "https://swe.quest/articles/change-data-capture-with-neon-and-materialize-b7e8c6b1f01b6525"
canonical: "https://neon.com/blog/cdc-with-materialize"
source: "Neon"
published: "2023-12-21"
difficulty: "medium"
kind: "How-to"
reading_minutes: 4
tags: ["event-driven","postgres","replication","stream-processing"]
---

# Change Data Capture with Neon and Materialize

A post on [Neon](https://swe.quest/sources/neon.md), published 2023-12-21, 4 min read, How-to. Original: [https://neon.com/blog/cdc-with-materialize](https://neon.com/blog/cdc-with-materialize)

## Summary

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.

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)
- [Stream processing](https://swe.quest/tags/stream-processing.md) (Data & databases)

## Prerequisites

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

## Keywords

Neon, Materialize, logical replication, Change Data Capture, REPLICA IDENTITY FULL, Debezium

## Related posts

- [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.
- [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.
- [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.
- [Build a Real-time Materialized View from Postgres Changes using Confluent’s ksqlDB](https://swe.quest/articles/build-a-real-time-materialized-view-from-postgres-changes-using-confluent-s-cfa507d6c7070e59.md): Neon · 2024-02-28 · Medium · 10 min read · Event-driven architecture, PostgreSQL, Stream processing, Queues & messaging
  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.
- [Event-driven architectures using Neon and Sequin](https://swe.quest/articles/event-driven-architectures-using-neon-and-sequin-8e1877ce94623987.md): Neon · 2024-10-22 · Medium · 5 min read · Event-driven architecture, PostgreSQL, Replication
  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.

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)
