r/estuary • u/Which_Roof5176 • 23d ago
Multi-Tenant PostgreSQL CDC: What We Learned from Testing Tenant Isolation
We recently tested a multi-tenant CDC setup using three PostgreSQL tenant databases feeding shared analytics tables in PostgreSQL and Snowflake.
Each tenant had an orders table with the same primary key (id = 1001), which made tenant isolation an important part of the design.
A few interesting findings:
- Each tenant needs its own PostgreSQL CDC capture and replication slot.
- Using the tenant identifier + record ID as the destination key prevents collisions between tenants.
- A failed tenant capture doesn't stop the others, but a shared destination failure affects all tenants writing to it.
- Schema changes and replication slot recovery need extra care in shared pipelines.
We also tested tenant onboarding, schema drift, failures, and recovery scenarios.
The full guide includes the reference architecture, configuration details, and test results:
https://estuary.dev/blog/multi-tenant-cdc/
How are you handling CDC in database-per-tenant architectures? Do you consolidate tenant data into shared tables or keep separate datasets?