Logical Replication Slots
Postgres logical replication slots are used to keep track of replication progress (recorded as a LSN). Every time a new version of Sync Rules or Sync Streams are deployed, PowerSync creates a new replication slot, then switches over and deletes the old replication slot when the reprocessing of the new Sync Rules/Streams version is done. The replication slots can be viewed using this query:| slot_name | confirmed_flush_lsn | active | lag |
|---|---|---|---|
| powersync_1_c3c8cf21 | 0/70D8240 | 1 | 56 bytes |
| powersync_2_e62d7e0f | 0/70D8240 | 1 | 56 bytes |
Maximum Replication Slots
Postgres is configured with a maximum number of replication slots per server. Since each PowerSync instance uses one replication slot for replication and an additional one while deploying a new Sync Rules/Streams version, the maximum number of PowerSync instances connected to one Postgres server is equal to the maximum number of replication slots, minus 1. If other clients are also using replication slots, this number is reduced further. The maximum number of slots can configured by settingmax_replication_slots (not all hosting providers expose this), and checked using: