---
title: "Introducing WalShadow: Sub-second Postgres replication to ClickHouse from physical WAL"
description: "WalShadow is an open-source engine that replicates Postgres to ClickHouse by decoding the physical WAL stream outside the source database, instead of using logical replication slots."
url: "https://swe.quest/articles/introducing-walshadow-sub-second-postgres-replication-to-clickhouse-from-722f53f940cda679"
canonical: "https://clickhouse.com/blog/introducing-walshadow"
source: "ClickHouse"
published: "2026-09-10"
difficulty: "medium"
kind: "Announcement"
reading_minutes: 5
tags: ["postgres","replication","event-driven","analytics","performance"]
---

# Introducing WalShadow: Sub-second Postgres replication to ClickHouse from physical WAL

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2026-09-10, 5 min read, Announcement. Original: [https://clickhouse.com/blog/introducing-walshadow](https://clickhouse.com/blog/introducing-walshadow)

## Summary

WalShadow is an open-source engine that replicates Postgres to ClickHouse by decoding the physical WAL stream outside the source database, instead of using logical replication slots. It replays catalog records into a schema-only shadow Postgres to track schema changes, decodes heap records in parallel with Rust workers, batches rows into ClickHouse-native blocks and inserts them concurrently. Out-of-order arrival is handled by tagging rows with the source LSN, with barriers for schema changes and truncations. In a single-table benchmark on c8i.2xlarge instances it reached about 200 ms commit-to-visible latency and 289K rows/sec, versus about 10 s and 120K rows/sec for the logical-replication-based PeerDB.

Written by swe.quest, not by the author.

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

## Topics

- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Replication](https://swe.quest/tags/replication.md) (Distributed systems)
- [Event-driven architecture](https://swe.quest/tags/event-driven.md) (Backend & APIs)
- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)

## Prerequisites

- Postgres WAL and replication ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- change data capture
- ClickHouse basics ([easy posts on Analytics & OLAP](https://swe.quest/tags/analytics.md?difficulty=easy))

## Keywords

WalShadow, ClickHouse, PostgreSQL, PeerDB, ClickPipes, ClickHouse Managed Postgres, WAL

## Related posts

- [What I learned from a month with WalShadow on ClickHouse Managed Postgres](https://swe.quest/articles/what-i-learned-from-a-month-with-walshadow-on-clickhouse-managed-postgres-89e5a8963b72573d.md): ClickHouse · 2026-11-06 · Medium · 16 min read · PostgreSQL, Replication, Event-driven architecture, Analytics & OLAP, Performance engineering
  WalShadow, which decodes physical Postgres WAL outside the database and writes blocks directly to ClickHouse, held median replication latency near 0.4 s from 1 to 200,000 rows/s on a 16 vCPU source.
- [Postgres at Open House NYC](https://swe.quest/articles/postgres-at-open-house-nyc-5b2de1c38cc64f40.md): ClickHouse · 2026-10-13 · Easy · 6 min read · PostgreSQL, Replication, Event-driven architecture, Analytics & OLAP
  ClickHouse used its Open House NYC keynote to launch WalShadow, an open-source engine that replicates Postgres into ClickHouse from the physical WAL instead of logical replication.
- [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.
- [OLTP is expensive, you can ClickHouse it.](https://swe.quest/articles/oltp-is-expensive-you-can-clickhouse-it-cd5e8f20ed5b5b0f.md): ClickHouse · 2026-10-15 · Easy · 6 min read · PostgreSQL, Analytics & OLAP, Cost optimization, Storage engines, Event-driven architecture
  Data that has stopped changing doesn't need Postgres's ACID machinery, so it can be offloaded to ClickHouse for roughly an order of magnitude better unit economics.
- [Change Data Capture (CDC) with PostgreSQL and ClickHouse - Part 1](https://swe.quest/articles/change-data-capture-cdc-with-postgresql-and-clickhouse-part-1-10e3d601e2748dab.md): ClickHouse · 2023-06-15 · Medium · 23 min read · Event-driven architecture, PostgreSQL, Analytics & OLAP, Replication, Queues & messaging
  Postgres-to-ClickHouse CDC can be built by streaming row changes from Postgres logical decoding (pgoutput plugin, replication slots, LSN ordering) through Debezium and Kafka, then applying them in ClickHouse with the ReplacingMergeTree engine.

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)
