Skip to main content
Streaming Query Replication (QRep) is a deprecated mirror type and no longer actively maintained. It remains fully functional and no code is currently being removed. We recommend CDC (Change Data Capture) as the actively-maintained mirror type for new mirrors.

Step 1: CREATE Two Postgres Peers

There is a guide available for creating a PostgreSQL peer here: CREATE Postgres PEER

Step 2: Create and populate tables on the source Postgres PEER

Run the following SQL on your source PostgreSQL peer to create and populate pgbench_history with dummy data:

Step 3: Create pgbench_history table on the destination PEER

Step 4: Kick off MIRROR with 8 threads and batch size of 10 seconds

Step 5: Monitor the MIRROR

You can connect to localhost:8085 to gain full visibility into the different jobs and steps that PeerDB performs under the hood to manage the MIRROR.

Step 6: Validate the MIRROR

In 1-2 minutes the MIRROR should complete syncing data. Now validate the data on both postgres peers. Number of rows should match on both sides.

Step 5: DROP MIRROR

To make it easy in your development and test environments, PeerDB also introduces the DROP MIRROR command. DROP MIRROR drops all the underlying objects that CREATE MIRROR generates. More details are available in this PR.