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

What lurks beneath

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 plug-and-play setup

Set up PowerSync dev mode in 3 simple steps

1. Configure SQL

Configure Write Ahead Logging (WAL) on PostgreSQL:
PostgreSQL config file

Example showing PostgreSQL config file

RDS config portal

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:
PowerSync user set up UI
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

PowerSync is a US patented product to easily sync SQL data to apps

Query SQLite directly, or use built-in ORM
Use whatever works best for you. By default, the SQLite schema matches your PostgreSQL schema.

Data filtering with sync rules
Define sync rules to filter and route data so users only see 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.

SDK is implemented in a NoSQL-like way
Client-side schema and data migrations are not necessary. Schema changes require reprocessing of sync tables. A resync may be required on the client side 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 logo
PostgreSQL
FRAMEWORKS
Flutter logo
Flutter
Support for these database and software frameworks coming soon
DATABASES
Microsoft SQL Server
MySQL
Oracle Database
FRAMEWORKS
React logo
React Native
Kotlin Multiplatform
Swift
Xamarin