PeerDB Cloud supports Supabase via IPv6 natively for seemless replication.
1
Creating a user with permissions and replication slot
Let’s create a new user for PeerDB with the necessary permissions suitable for CDC,
and also create a publication that we’ll use for replication. For this, you can head over to the SQL Editor for your Supabase Project.
Click on Run to have a publication and a user ready.
-
Create a dedicated user for PeerDB:
-
-
Grant schema-level, read-only access to the user you created in the previous step. The following example shows permissions for the
publicschema. Repeat these commands for each schema containing tables you want to replicate: -
-
Grant replication privileges to the user:
-
-
Create a publication with the tables you want to replicate. We strongly recommend only including the tables you need in the publication to avoid performance overhead.
Any table included in the publication must either have a primary key defined or have its replica identity configured to
FULL.- To create a publication for specific tables:
-
To create a publication for all tables in a specific schema:
peerdb_publicationpublication will contain the set of change events generated from the specified tables, and will later be used to create the MIRROR (replication).

User and publication commands
Make sure to replace
peerdb_user and peerdb_password with your desired username and password.Also, remember to use the same publication name when creating the mirror in PeerDB.2
Create the Supabase Peer on PeerDB Cloud
Make sure you are signed in to your Supabase console for this step.
- Head over to the PeerDB UI and click on Create Peer. Select Supabase as the source.

Select Supabase peer
- You should be redirected to Supabase to authorize PeerDB to access your Supabase Project. Make sure to select the correct organization from the dropdown and click on Authorize PeerDB.

Authorize PeerDB
- You should now see a list of your Supabase Projects. Click on the project you want to create the peer for.

Select the Supabase Project
- Once you select the project, you should see a screen like below with connection details filled in automatically. Fill in the username and password you created earlier in the SQL Editor in Step 1.

Create the Supabase Peer
- Click on Validate and once that’s green, you can go ahead and click on Create to create the peer!
The PeerDB user must not be restricted by RLS policies, as it can lead to missing data. You can disable RLS policies for the user by running the below command:
3
Increase max_slot_wal_keep_size
This is a recommended configuration change to ensure that large transactions/commits do not cause the replication slot to be dropped.You can increase the
max_slot_wal_keep_size parameter for your Supabase database to a higher value (at least 100GB or 102400) by following the Supabase DocsFor better recommendation of this value you can contact the PeerDB team.When creating the Mirror, make sure to reuse the same publication you created earlier in Step 1

