Source Database Setup
Configure your backend database for PowerSync
Postgres
Version compatibility: PowerSync requires Postgres version 11 or greater.
Configuring your Postgres database with PowerSync generally involves three tasks:
- Enable logical replication
- Create a PowerSync database user
- Create
powersync
publication
We have documented steps for some hosting providers:
For other providers and self-hosted databases:
Unsupported Hosted Postgres Providers
Due to the logical replication requirement, not all hosting providers are supported.
Notably, some “serverless Postgres” providers do not support logical replication, and are therefore not supported by PowerSync yet.
MongoDB (Alpha)
This section is a work in progress. More details for MongoDB connections are coming soon. In the meantime, check our MongoDB guide to try out our MongoDB alpha support, and ask on our Discord server if you have any questions.
Version compatibility: PowerSync requires MongoDB version 6.0 or greater.
PowerSync requires the find
and changeStream
permissions on all databases and collections.
PowerSync also requires createCollection
, insert
, update
, and remove
permissions to the _powersync_checkpoints
collection.
For MongoDB Atlas users, PowerSync requires readWrite@mydb._powersync_checkpoints
and readAnyDatabase@admin
MySQL (Alpha)
This section is a work in progress. More details for MySQL connections are coming soon. In the meantime, ask on our Discord server if you have any questions.
Version compatibility: PowerSync requires MySQL version 5.7 or greater.
MySQL connections use the binary log to replicate changes.
Generally, this requires the following config:
gtid_mode
:ON
enforce_gtid_consistency
:ON
binlog_format
:ROW
PowerSync also requires a user with replication permissions on the database. An example:
Next Step
Next, connect PowerSync to your database:
Self-hosting: If you are self-hosting PowerSync, refer to PowerSync Service Setup next.
Was this page helpful?