---
title: "Replication redefined: How we built a low-latency, multi-tenant data replication platform"
description: "Datadog grew a single Postgres-to-search replication pipeline into a multi-tenant CDC platform built on Debezium, Kafka, and Kafka Connect."
url: "https://swe.quest/articles/replication-redefined-how-we-built-a-low-latency-multi-tenant-data-replication-467db62624b6c7cc"
canonical: "https://www.datadoghq.com/blog/engineering/cdc-replication-search/"
source: "Datadog Engineering"
published: "2025-11-04"
difficulty: "medium"
kind: "Case study"
reading_minutes: 10
tags: ["event-driven","replication","postgres","messaging","schema-migrations"]
---

# Replication redefined: How we built a low-latency, multi-tenant data replication platform

A post on [Datadog Engineering](https://swe.quest/sources/datadog.md), published 2025-11-04, 10 min read, Case study. Original: [https://www.datadoghq.com/blog/engineering/cdc-replication-search/](https://www.datadoghq.com/blog/engineering/cdc-replication-search/)

## Summary

Datadog grew a single Postgres-to-search replication pipeline into a multi-tenant CDC platform built on Debezium, Kafka, and Kafka Connect. Offloading join-heavy faceted search from a shared Postgres database into a search platform, with data denormalized during replication, cut page loads from about 30 s to about 1 s while keeping replication lag near 500 ms. The platform favors asynchronous replication for availability and throughput, and uses Temporal workflows to automate provisioning steps such as logical replication setup, slots, topics, heartbeat tables, and sink connectors. Pre-migration SQL validation and a backward-compatible Schema Registry keep schema changes from breaking pipelines, while single message transforms and an enrichment API let teams customize their data.

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)
- [Replication](https://swe.quest/tags/replication.md) (Distributed systems)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Queues & messaging](https://swe.quest/tags/messaging.md) (Backend & APIs)
- [Schema migrations](https://swe.quest/tags/schema-migrations.md) (Data & databases)

## Prerequisites

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

## Keywords

Debezium, Kafka Connect, Temporal, Kafka Schema Registry, Elasticsearch, Avro, Apache Iceberg

## Related posts

- [How Seemplicity scaled real-time security analytics with Postgres CDC and ClickHouse](https://swe.quest/articles/how-seemplicity-scaled-real-time-security-analytics-with-postgres-cdc-and-c80fc0ac79e77c01.md): ClickHouse · 2025-05-29 · Easy · 6 min read · Event-driven architecture, Analytics & OLAP, PostgreSQL, Multi-tenancy, Data pipelines
  Seemplicity, a security remediation platform aggregating findings from 150+ tools, outgrew a Postgres-only design as heavy upserts, table bloat and multi-table joins across ~16 per-tenant tables slowed customer dashboards.
- [How SewerAI is using ClickHouse to modernize sewer management at scale](https://swe.quest/articles/how-sewerai-is-using-clickhouse-to-modernize-sewer-management-at-scale-b730a0ec357c6359.md): ClickHouse · 2025-09-19 · Medium · 7 min read · Analytics & OLAP, Data pipelines, Performance engineering, Cost optimization, PostgreSQL
  SewerAI replicates its Postgres transactional data into ClickHouse via CDC (moving from Confluent/Debezium to self-hosted Debezium+Kinesis to PeerDB, and now ClickPipes) and uses materialized and refreshable materialized views to denormalize 40+ tables into a single hundreds-of-billions-row "Megatable" for real-time municipal analytics.
- [“Just OLAP it”: How Ramp rebuilt its analytics platform on ClickHouse Cloud](https://swe.quest/articles/just-olap-it-how-ramp-rebuilt-its-analytics-platform-on-clickhouse-cloud-36298842faab88cc.md): ClickHouse · 2026-01-20 · Medium · 5 min read · Analytics & OLAP, Event-driven architecture, Data pipelines, PostgreSQL, Queues & messaging
  Ramp moved customer-facing spend analytics off its Postgres monolith after enterprise customers' reports on a single card-transactions table began taking 40+ seconds, and now serves them in milliseconds from ClickHouse Cloud.
- [Postgres CDC in ClickHouse, A year in review](https://swe.quest/articles/postgres-cdc-in-clickhouse-a-year-in-review-6b9d350bcade98d4.md): ClickHouse · 2025-12-03 · Medium · 13 min read · PostgreSQL, Event-driven architecture, Data pipelines, Analytics & OLAP, Replication
  A year after PeerDB's acquisition, Postgres CDC into ClickHouse via ClickPipes has grown to 400+ companies replicating over 200 TB per month, driven by real-time customer-facing analytics and data warehousing workloads.
- [Change Data Capture (CDC) with PostgreSQL and ClickHouse - Part 2](https://swe.quest/articles/change-data-capture-cdc-with-postgresql-and-clickhouse-part-2-2123f803752f2e9d.md): ClickHouse · 2023-06-15 · Medium · 22 min read · Event-driven architecture, PostgreSQL, Analytics & OLAP, Data pipelines, Replication
  A Postgres-to-ClickHouse CDC pipeline is built with Debezium, Kafka Connect and a ClickHouse materialized view, keeping a ReplacingMergeTree table in sync with the 28M-row UK property price dataset under a mix of inserts, updates and deletes.

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)
