Replication redefined: How we built a low-latency, multi-tenant data replication platform
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.
Related posts
- How Seemplicity scaled real-time security analytics with Postgres CDC and ClickHouse
ClickHouse easyNovice
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. It kept Postgres as the transactional layer and streamed changes into ClickHouse via PeerDB (now ClickPipes), choosing it over a Debezium–Kafka pipeline to avoid extra failure points. A multi-region staging-then-per-tenant-schema layout and denormalized AggregatingMergeTree tables with materialized views removed query-time joins. Dashboards that once took minutes now return in seconds or milliseconds, and storage is roughly 10 TB, an estimated 5–6x smaller than Postgres, while handling tens of billions of updates per month.
- How SewerAI is using ClickHouse to modernize sewer management at scale
ClickHouse mediumAdept
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. Bulk customer operations caused update failures and backlogs because compute was always near its limit. The fixes were incremental refreshes over only the last ~70 seconds of data, projections on clean tables, dictionaries instead of LEFT ANY joins, join ordering, LIMIT instead of DISTINCT, and filtering before joins, which alone gave about 3x speed at half the compute. With these changes, data volume tripled and read/write operations rose tenfold while compute usage stayed flat.
- “Just OLAP it”: How Ramp rebuilt its analytics platform on ClickHouse Cloud
ClickHouse mediumAdept
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. The pipeline streams Postgres CDC via Debezium into per-table Kafka topics. Stateless Python enrichers denormalize the records, and a connector loads them into ReplacingMergeTree tables, with recurring OPTIMIZE and FINAL queries handling deduplication. A local benchmark of 60M transactions partitioned by business ID ran 16,000 randomized queries in 12 seconds, and a four-engineer pod shipped to production in about two months. The platform now backs in-app Reporting and Budgets, and Ramp plans to add enriched tables for every core data type.
- Postgres CDC in ClickHouse, A year in review
ClickHouse mediumAdept
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. Key engineering changes include keeping logical replication connections open, because reconnects re-read WAL from restart_lsn and spiked lag. CTID block-based partitioning cut initial-load partition generation from 7+ hours to under a second, and 50+ pre-flight checks plus bucketed user-facing alerts cut on-call load by orders of magnitude. The biggest remaining gap is data modeling overhead from ReplacingMergeTree's asynchronous deduplication, which ClickHouse plans to address with lightweight UPDATEs and unique indexes.
- Change Data Capture (CDC) with PostgreSQL and ClickHouse - Part 2
ClickHouse mediumAdept
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. Key configuration choices include REPLICA IDENTITY FULL (required for delete support), the pgoutput logical decoding plugin, per-row ordering via a single or hash-partitioned Kafka topic, and version/deleted columns in the ReplacingMergeTree engine. The ORDER BY is chosen for analytical access patterns, with the Postgres id appended last for uniqueness. The initial load uses the postgresql table function via INSERT INTO SELECT, which loads all 28M rows in about 80 seconds without tuning but requires pausing writes; Debezium's consistent snapshot is the alternative.