Back to blog

Replicating PostgreSQL To ClickHouse With WalShadow Part 3 - Managed WalShadow Versus ClickPipes On ClickHouse Managed Postgres

Lukáš Kozelnický
2026-11-30
8 min read
Featured image for Replicating PostgreSQL To ClickHouse With WalShadow Part 3 - Managed WalShadow Versus ClickPipes On ClickHouse Managed Postgres

This is part three of a three part series: part one: WalShadow open source · part two: performance and operational comparison with PeerDB and Debezium · part three (this article).

In part one we ran the open source WalShadow against our own PostgreSQL, and in part two we compared it with PeerDB and Debezium. The self-hosted version has one hard blocker: it needs a physical replication connection, which managed PostgreSQL services do not give to external consumers.

ClickHouse now runs its own Managed Postgres and offers WalShadow as a managed replication method, next to ClickPipes. At the time of writing, WalShadow is in private preview. In this article we ran both WalShadow and ClickPipes against one Managed Postgres instance at the same time, so both pipelines saw exactly the same writes and schema changes, and we checked whether part two's results still hold.

WalShadow In Managed Postgres

Managed Postgres has a Sync to ClickHouse feature with two replication methods, ClickPipes and WalShadow, the latter in private preview. Both ClickPipes and WalShadow are free for replicating data from Managed Postgres to ClickHouse.

Figure 1. Sync data to ClickHouse from Managed Postgres.

The Sync to ClickHouse set up screen in ClickHouse Cloud, with ClickPipes and WalShadow (private preview, sub-second lag) offered as the replication engine
The Sync to ClickHouse set up screen in ClickHouse Cloud, with ClickPipes and WalShadow (private preview, sub-second lag) offered as the replication engine

When you set up WalShadow, you choose the destination ClickHouse service, the source database, the flush interval, the replication method (initial load and CDC, initial load only, or CDC only), the destination database, the destination name and the column settings per table.

How We Tested

The idea was to repeat every test scenario from part two that a managed service allows, i.e. schema changes, performance and daily operations, and compare each result with part two.

Figure 2. Managed Postgres instances replicating to ClickHouse Cloud services.

One source, two pipelines written at the same time: two Managed Postgres instances, a small 10 GB database with 42M rows in 60 tables and a large 50 GB database with 215M rows in 72 tables, each with a physical slot for WalShadow and a logical slot for ClickPipes, replicating to two ClickHouse Cloud services of 2 vCPU and 8 GB RAM
One source, two pipelines written at the same time: two Managed Postgres instances, a small 10 GB database with 42M rows in 60 tables and a large 50 GB database with 215M rows in 72 tables, each with a physical slot for WalShadow and a logical slot for ClickPipes, replicating to two ClickHouse Cloud services of 2 vCPU and 8 GB RAM

Sources: two Managed Postgres 18.7 instances with 2 vCPU and 8 GB of RAM each. One was a "small" 10 GB database with 42M rows in 60 tables. The second was a "large" 50 GB database with 215M rows in 72 tables. We used the option to move data there with pg_dump / pg_restore.

Destinations: two ClickHouse Cloud services (26.6), 2 vCPU and 8 GB RAM each, so one pipeline's inserts cannot slow the other's.

ClickPipes ran with its defaults: a 60 s sync interval, Preserve NULL values on, Remove deleted rows on, and none of PeerDB's optional primary-key-update or CDC-store settings. So its fair comparison is part two's PeerDB as shipped.

WalShadow ran with its defaults, a 500 ms flush interval.

During our tests we were mostly curious about three things:

  • Data freshness (commit-to-query latency): how long after a commit in PostgreSQL a row can be queried in ClickHouse.
  • Burst throughput: how quickly each pipeline catches up after a sudden large write, and what that write costs ClickHouse.
  • Schema changes: whether DDL changes give the same results as in part two, now that both tools are managed.

We checked correctness on values, not on row counts, against ClickHouse FINAL, the same way as in part two.

Data Freshness

We inserted one probe row every 250 ms while a mixed INSERT, UPDATE and DELETE load ran for 300 s, and timed each probe from commit until it was visible in ClickHouse. The tables show the small database (10 GB) run, but for the large database the results were almost the same, as expected.

Typical delay (p50)

Pipeline500 rows/s2,000 rows/s
WalShadow (500 ms)611.7 to 623.8 ms581.9 to 690.5 ms
ClickPipes, 10 s interval5,707.8 ms5,687.2 ms
ClickPipes, 60 s interval (default)30,790.5 ms28,694.7 ms

Slowest 1% (p99)

Pipeline500 rows/s2,000 rows/s
WalShadow (500 ms)832.6 ms827.3 ms
ClickPipes, 10 s interval10,635 ms10,602.8 ms
ClickPipes, 60 s interval (default)60,187.4 ms53,226.3 ms

Figure 3. Median visible latency at 2,000 rows/s.

Median visible latency on a log scale, 10 GB dataset at 2,000 rows/s for 300 s: WalShadow 581.9 ms with its 500 ms flush, ClickPipes 28,694.7 ms with the default 60 s sync and 5,687.2 ms with a 10 s sync
Median visible latency on a log scale, 10 GB dataset at 2,000 rows/s for 300 s: WalShadow 581.9 ms with its 500 ms flush, ClickPipes 28,694.7 ms with the default 60 s sync and 5,687.2 ms with a 10 s sync

The sub-second figures are not exact. We measured from a laptop, so every measurement includes network latency to the ClickHouse services. WalShadow's real delay is probably lower. Treat these figures as a comparison between the two tools rather than as absolute latency.

ClickPipes: the median delay was about half the sync interval, 28.7 to 30.9 s at 60 s and 5.7 to 6.1 s at 10 s, on both dataset sizes. Lowering the interval is how you reduce it. Going lower than 10 s is not recommended.

WalShadow: on Managed Postgres it uses a 500 ms flush interval, which is configurable. We kept 500 ms, and the median stayed between 562 and 690.5 ms in all measurements.

ClickPipes Writes Every Row Twice

For the 1M-row burst, ClickPipes wrote 2,000,000 rows into ClickHouse and WalShadow wrote 1,000,000. This is expected and documented, because a ClickPipe first writes change events to a raw table, _peerdb_raw_mirror_<pipe id>, in the destination database, and then normalises them into the target tables. So each change is written once to the raw table and once to the target.

BurstDatasetPipelineRows writtenInsert timePeak memory
1M-row insertSmall (10 GB)WalShadow1,000,000799 ms182 MB
ClickPipes2,000,0001,887 ms380 MB
1M-row insertLarge (50 GB)WalShadow1,000,0001,121 ms56 MB
ClickPipes2,000,0001,938 ms380 MB

All the measures are on the ClickHouse side, taken from system.query_log for the INSERT queries into the destination database. Insert time is the sum over those queries, and peak memory is the largest single query. It is not the memory of the replication tool, which a managed service does not show.

Insert time: ClickPipes took longer on both sizes, 1.7 to 2.4 times.

Peak memory: ClickPipes was higher in every burst and similar across sizes for the insert (380 MB). WalShadow's varied more between runs (56 to 182 MB), so do not rely on one ratio.

Figure 4. Insert time per 1M-row burst.

Insert time for the 1M-row insert, summed over the INSERT queries in system.query_log: 10 GB dataset WalShadow 799 ms against ClickPipes 1,887 ms; 50 GB dataset WalShadow 1,121 ms against ClickPipes 1,938 ms
Insert time for the 1M-row insert, summed over the INSERT queries in system.query_log: 10 GB dataset WalShadow 799 ms against ClickPipes 1,887 ms; 50 GB dataset WalShadow 1,121 ms against ClickPipes 1,938 ms

DDL Schema Changes

We applied the 21 schema changes from part two on the Managed Postgres while both pipelines were running, and compared every value afterwards. The results on the managed services were the same as in part two: managed WalShadow behaved like the open source WalShadow, and ClickPipes behaved like PeerDB with its default settings. There was one small difference in form for ClickPipes, which left a generated column out of the destination where PeerDB had kept the column with NULLs. We decided not to repeat the tables here, as part two explains each case.

Recovery

We stopped both ClickHouse services for 1 minute under a load of 500 rows/s, then started them again and measured how long each pipeline needed to catch up.

WalShadow was back in 3.4 s. In part two, the self-hosted daemon needed 46.6 s, because it exited and waited for its supervisor to restart it. The load was lower here (500 against 2,000 rows/s), so the two numbers are not a like-for-like comparison, but the difference is still worth mentioning.

ClickPipes needed about two and a half sync intervals. It took 144.3 s with a 60 s interval, close to PeerDB's 157.6 s in part two.

Conclusion

The results in part two made managed WalShadow worth testing, and this test confirmed it. Even though it is still in private preview, it is a good candidate to try with Managed Postgres. Latency is where it excels, with a median of only 0.6 s against 29 to 31 s with the default ClickPipes settings (about 6 s at a 10 s interval). But speed is not the only advantage. WalShadow supports more schema changes natively than ClickPipes does.

On the other hand, monitoring is where ClickPipes is ahead, but the ClickHouse documentation for WalShadow says that operations and more detailed metrics are still on the roadmap.

If you are weighing up a move from PostgreSQL to ClickHouse, or already run ClickPipes and want to see whether WalShadow fits your workload, get in touch. We run this kind of comparison for clients on their own data as part of a migration.

Written by

Lukáš Kozelnický

ClickHouse Engineer, New Cadence

We are an independent ClickHouse consultancy. We help businesses deploy ClickHouse open source and ClickHouse Cloud, build solutions on top of ClickHouse for real-time analytics, observability and AI, and resolve performance and reliability issues with their existing deployments.

End of article Share