In order for ParadeDB to run as a logical subscriber, ParadeDB must be using
Postgres 17+.
- Your primary Postgres runs on a managed service such as AWS RDS, Aurora, Cloud SQL, AlloyDB, or Azure Database for PostgreSQL
- You want search and analytics queries to run away from your OLTP workload
- You want to keep Postgres as the system of record and add ParadeDB as a dedicated read and search node
Managed Postgres Providers
Each managed provider has its own prerequisite steps for enabling logical replication. In every case, the managed database is the publisher and ParadeDB is the subscriber.- AWS RDS/Aurora: Follow AWS’ tutorial
- Azure Database for PostgreSQL: Follow Azure’s tutorial
- Cloud SQL for PostgreSQL: Follow Google’s tutorial
- AlloyDB for PostgreSQL: Follow Google’s tutorial
Azure Cosmos DB for PostgreSQL does not support logical
replication.
Self-Hosted Postgres
The example below shows a minimal self-hosted setup where Postgres publishes changes and ParadeDB subscribes to them.Environment Setup
We’ll use the following environment: Publisher- OS: Ubuntu 24.04
- IP: 192.168.0.30
- Database Name:
marketplace - Replication User:
replicator - Replication Password:
passw0rd
- OS: Ubuntu 24.04
- IP: 192.168.0.31
1. Configure the Publisher
Ensure thatpostgresql.conf on the publisher has the following settings:
max_replication_slots and max_wal_senders for the initial
copy phase, not just the steady-state subscription. For sizing guidance, see
Choose Publication and Subscription Boundaries.
Then allow the subscriber to connect in pg_hba.conf:
2. Create the Source Schema on the Publisher
Create a database and a table on the publisher:mock_items has a primary key, it already has a valid replica identity
for INSERT, UPDATE, and DELETE, so no additional replica identity
configuration is needed here.
3. Bootstrap the Schema on ParadeDB
Logical replication does not copy schema definitions, so create the same database and tables on ParadeDB before you subscribe. A schema-only dump is the simplest way to do this:CREATE SUBSCRIPTION.
4. Install and Load pg_search on ParadeDB
Deploy ParadeDB on the subscriber, then load the extension in the subscriber database:
5. Create a Publication on the Publisher
6. Create a Subscription on ParadeDB
WITH (copy_data = false) and backfill the tables by another
method.