Deploying PeerDB
We currently support deploying and testing PeerDB using our Docker Compose file.Docker can be installed by referring to these instructions.
The
docker compose tool should also be present. The Postgres client tools (specifically
psql) are used to test the PeerDB installation.-
Run the following commands in your terminal:
-
Connect to PeerDB:
Quickstart
The following steps assume you have PeerDB running locally. We also need the Postgres
client tools (specifically
psql and pgbench) installed and available on your
PATH.Setup
This script reuses the PeerDB internal Postgres instance to setup two databases, which we can use to create two peers. It also creates some tables on both databases to use later in the quickstart. Run the following commands in your terminal:Creating Peers
With PeerDB running, we can create our first peers. Connect to PeerDB via psql and run the below commands to create thesource and target peers:
Real-time CDC
Run the following command to kick off Change Data Capture (CDC) based streaming from source peer to target peer for thetest table.
Streaming Query from PostgreSQL
Run the following command to kick off query based streaming from source peer to target peer. You are able to maskc1,c2 and t columns by hashing them prior to streaming them to the target.
Mirrors are continuous
As you add more rows to thetest table on the source, the above MIRRORs take care of replicating the data to both test and test_transformed table on the target.
Insert a new row on the source:
FAQ
If you have any questions about the PeerDB setup and deployment process, don’t hesitate to reach out on Slack. We’re more than happy to assist and answer any questions, including:- What is the performance I can expect during CDC and query based replication?
- How do I know my data sync is successful?
- Can I set a specific time to start my data sync?

