# Build a Real-time Materialized View from Postgres Changes using Confluent's ksqlDB

DevFeed: [Build a Real-time Materialized View from Postgres Changes using Confluent's ksqlDB](<https://devfeed.tech/articles/build-a-real-time-materialized-view-from-postgres-changes-using-confluent-s-ksqldb-5763.md>)

Original publisher: [Read original article](<https://neon.com/blog/real-time-materialized-view-postgres-kafka-ksqldb>)

Author: Evan Shortiss

Published: 2024-02-28T17:33:42Z

Content type: tutorial

Language: en

Sources: [Blog -- Neon Docs](<https://devfeed.tech/sources/blog-neon-docs.md>)

Topics: [Kafka](<https://devfeed.tech/topics/kafka.md>), [Replication](<https://devfeed.tech/topics/replication.md>), [Streaming](<https://devfeed.tech/topics/streaming.md>), [real-time](<https://devfeed.tech/topics/real-time.md>), [Messaging](<https://devfeed.tech/topics/messaging.md>), [Microservice](<https://devfeed.tech/topics/microservice.md>), [data](<https://devfeed.tech/topics/data.md>), [Databases](<https://devfeed.tech/topics/databases.md>), [Cloud](<https://devfeed.tech/topics/cloud.md>), [Architecture & Design](<https://devfeed.tech/topics/architecture-design.md>), [Publish-subscribe pattern](<https://devfeed.tech/topics/pubsub.md>), [ide](<https://devfeed.tech/topics/ide.md>)

Tags: [apache-kafka](<https://devfeed.tech/tags/apache-kafka.md>), [architectures](<https://devfeed.tech/tags/architectures.md>), [cloud](<https://devfeed.tech/tags/cloud.md>), [community](<https://devfeed.tech/tags/community.md>), [components](<https://devfeed.tech/tags/components.md>), [confluent](<https://devfeed.tech/tags/confluent.md>), [confluent-cloud](<https://devfeed.tech/tags/confluent-cloud.md>), [data](<https://devfeed.tech/tags/data.md>), [events](<https://devfeed.tech/tags/events.md>), [messaging](<https://devfeed.tech/tags/messaging.md>), [microservices](<https://devfeed.tech/tags/microservices.md>), [performance](<https://devfeed.tech/tags/performance.md>), [postgres](<https://devfeed.tech/tags/postgres.md>), [real-time](<https://devfeed.tech/tags/real-time.md>), [replication](<https://devfeed.tech/tags/replication.md>), [sql](<https://devfeed.tech/tags/sql.md>), [streaming](<https://devfeed.tech/tags/streaming.md>)

## AI overview

This tutorial explains how to stream changes from a Neon Postgres database to Apache Kafka and use ksqlDB on Confluent Cloud to build a real-time materialized view. It contrasts this approach with refreshing a Postgres materialized view after each write, highlighting performance, history retention, and reliable downstream notifications.

## Source excerpt

Neon's support for Postgres' logical replication features opens up a variety of interesting use cases, including for real-time streaming architectures based on change data capture. We previously demonstrated how to use Debezium to fan-out changes from Postgres by using Redis as a...