Plug-and-play offline-first
for apps with SQL backends

PowerSync is a cloud service and SDK that keeps SQL databases
in sync with on-device SQLite databases.

Data sync may appear straightforward,
but there are many
hidden complexities

What meets the eye

basic data sync setup stepsbasic data sync setup steps

What lurks beneath

challenges of data sync setupchallenges of data sync setup

PowerSync: A drop-in sync system for instant offline-first functionality

Connect PowerSync to your SQL database and existing backend API. No SQL write permission required. The PowerSync SDK sends writes back to your backend API, allowing you to keep using the business logic in your existing backend application.

powersync data sync architecturepowersync data sync architecture

Why PowerSync?

Stick with proven SQL technologies while adding a complete sync system.
Including a way to dynamically partition sync data — one of the hardest problems in data syncing.

SQL-based

SQL backend database being synced with client SQLite database.

Stick with proven SQL technologies on both your backend and client.

Built-in Sync Rules
System

Data from cloud database being automatically partitioned and synced according to sync rules

Sync Rules are a highly versatile way to control which data gets synced to which users. Read more.

PowerSync plug-and-play setup

Set up PowerSync dev mode in 3 simple steps

1. Configure SQL

Configure Write Ahead Logging (WAL) on PostgreSQL:
postgresql wal setup

Example showing PostgreSQL config file

aws postgresql setup

Example showing Amazon RDS

Create PowerSync user on PostgreSQL (the fastest way to test is to grant all privileges; write privileges are not required for production):
-- SQL to create powersync user
CREATE ROLE powersync WITH REPLICATION LOGIN PASSWORD 'powersync123';
GRANT ALL PRIVILEGES ON DATABASE mydb TO powersync;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO powersync;

2. Add your SQL database on PowerSync

Create PowerSync user on SQL:
sql powersync user setup
At this point PowerSync will automatically confirm your database is correctly configured.

3. Add PowerSync SDK to your app

Add the PowerSync library to your Flutter app project:
flutter pub add powersync
Use PowerSync in your Flutter app:
// Initialize PowerSync SDK (open database and connect to PowerSync)
var db = new PowerSyncDatabase(endpoint: "mypowersync123.powersync.co", devMode: true);

// Run queries
var results = await db.select("SELECT * FROM assets");
print(results);

// Insert data
await db.execute("INSERT INTO assets(id, make, model) VALUES (uuid(), ?, ?)", "test", "test")
You now have PowerSync set up in dev mode!  🥳 🥳 🥳
Add the PowerSync library to your React Native app project:
npm add powersync
Use PowerSync in your React Native app:
// Initialize PowerSync SDK (open database and connect to PowerSync)
let db = new PowerSyncDatabase({endpoint: "mypowersync123.powersync.co", devMode: true});

// Run queries
let results = await db.select("SELECT * FROM assets");
print(results);

// Insert data
await db.execute("INSERT INTO assets(id, make, model) VALUES (uuid(), ?, ?)", "test", "test")
You now have PowerSync set up in dev mode!  🥳 🥳 🥳

Set PowerSync up for production

Production Setup

After setting PowerSync up for dev mode, you can follow these steps to set it up for production:

1. Add authentication
In your backend, add an endpoint to generate PowerSync JWT tokens. In your app, use this endpoint to get an JWT authentication token.

2. Add custom write APIs
In your backend, add endpoints to write data (or use existing ones). In your app, hook up these endpoints.

3. Add sync rules on PowerSync dashboard

4. Configure client-side schema
Start with auto-generated schema on the PowerSync dashboard (generated from your SQL database), then customize as needed. Add this to your app.

5. Disable dev mode

We built a complete sync system so you don't have to.

Real-time data streaming
The client SDK supports real-time streaming of changes, and can automatically rerun a query if the underlying data changed.

Data filtering with sync rules
Define sync rules to filter and route data so client databases only persist data that's relevant to them.

Supports custom conflict resolution
Because all writes go through your backend API, you can easily add custom conflict resolution logic.

Super fast SQLite performance
The PowerSync SDK includes several optimizations that result in incredibly fast database queries and writes.

No migrations necessary
Client-side schema and data migrations are not necessary. Schema changes only require some reprocessing which is handled automatically.

Multiple databases, one cloud service
Multiple source databases can be connected to one instance of the PowerSync cloud Service.

PowerSync supports the following database and software frameworks
DATABASES
PostgreSQL
FRAMEWORKS
Flutter
Support for these database and software frameworks coming soon
DATABASES
Microsoft SQL Server
MySQL
Oracle Database
FRAMEWORKS
React Native
Kotlin Multiplatform
Swift
Xamarin