diff --git a/installation/database-setup.mdx b/installation/database-setup.mdx index a19e285..0b9459b 100644 --- a/installation/database-setup.mdx +++ b/installation/database-setup.mdx @@ -17,7 +17,7 @@ import PostgresPowerSyncPublication from '/snippets/postgres-powersync-publicati Configuring your Postgres database for PowerSync generally involves three tasks: -1. Enable logical replication +1. Ensure logical replication is enabled 2. Create a PowerSync database user 3. Create `powersync` logical replication publication @@ -25,9 +25,9 @@ We have documented steps for some hosting providers: - ### 1. Enable logical replication + ### 1. Ensure logical replication is enabled - Supabase has logical replication enabled by default — no action required. + No action required: Supabase has logical replication enabled by default. ### 2. Create a PowerSync database user @@ -47,13 +47,14 @@ We have documented steps for some hosting providers: Access may be restricted to specific IPs if required — see [IP Filtering](/installation/database-setup/security-and-ip-filtering). - ### 1. Enable logical replication + ### 1. Ensure logical replication is enabled Set the `rds.logical_replication` parameter to `1` in the parameter group for the instance: ![](/images/setup-2.png) + ### 2. Create a PowerSync database user Create a PowerSync user on Postgres: @@ -83,7 +84,7 @@ We have documented steps for some hosting providers: The database must be accessible on the public internet. Once you have created your database, navigate to **Settings** → **Networking** and enable **Public access.** - ### 1. Enable logical replication + ### 1. Ensure logical replication is enabled Follow the steps as noted in [this Microsoft article](https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/concepts-logical#prerequisites-for-logical-replication-and-logical-decoding) to allow logical replication. @@ -96,7 +97,7 @@ We have documented steps for some hosting providers: - ### 1. Enable logical replication + ### 1. Ensure logical replication is enabled In Google Cloud SQL Postgres, enabling the logical replication is done using flags: @@ -114,14 +115,14 @@ We have documented steps for some hosting providers: Neon is a serverless Postgres environment with an innovative pricing model that separates storage and compute. - ### 1. Enable Logical Replication + ### 1. Ensure logical replication is enabled - To [enable logical replication](https://neon.tech/docs/guides/logical-replication-postgres#prepare-your-source-neon-database): + To [Ensure logical replication is enabled](https://neon.tech/docs/guides/logical-replication-postgres#prepare-your-source-neon-database): 1. Select your project in the Neon Console. 2. On the Neon Dashboard, select **Settings**. 3. Select **Logical Replication**. - 4. Click **Enable** to enable logical replication. + 4. Click **Enable** to Ensure logical replication is enabled. ### 2. Create a PowerSync database user @@ -134,9 +135,9 @@ We have documented steps for some hosting providers: Fly Postgres is a [Fly](https://fly.io/) app with [flyctl](https://fly.io/docs/flyctl/) sugar on top to help you bootstrap and manage a database cluster for your apps. - ### 1. Enable logical replication + ### 1. Ensure logical replication is enabled - Once you've deployed your Fly Postgres cluster, you can use the following command to enable logical replication: + Once you've deployed your Fly Postgres cluster, you can use the following command to Ensure logical replication is enabled: ```bash fly pg config update --wal-level=logical @@ -154,9 +155,9 @@ We have documented steps for some hosting providers: - ### 1. Enable logical replication + ### 1. Ensure logical replication is enabled - `wal_level = logical` is required and PlanetScale has this set by default - no action needed. + No action required: PlanetScale has logical replication (`wal_level = logical`) enabled by default. ### 2. Create a PowerSync database user @@ -181,7 +182,7 @@ For other providers and self-hosted databases: Need help? Simply contact us on [Discord](https://discord.gg/powersync) and we'll help you get set up. - ### 1. Enable logical replication + ### 1. Ensure logical replication is enabled PowerSync reads the Postgres WAL using logical replication in order to create sync buckets in accordance with the specified PowerSync [Sync Rules](/usage/sync-rules). @@ -190,14 +191,14 @@ For other providers and self-hosted databases: ![](/images/setup-6.avif) - Alternatively, you can use the below SQL commands to check and enable logical replication: + Alternatively, you can use the below SQL commands to check and Ensure logical replication is enabled: ```sql -- Check the replication type SHOW wal_level; - -- Enable logical replication + -- Ensure logical replication is enabled ALTER SYSTEM SET wal_level = logical; ```