Skip to content

Postgres Sync

Read-path sync engine for Postgres that handles partial replication, data delivery and fan-out.

Postgres sync engine

Postgres Sync is a sync engine that syncs subsets of your data out of your Postgres database, into local apps and services.

Use cases diagram

You can sync data into anything you like. From web, mobile and desktop apps and client stores like TanStack DB to databases like PGlite.

🎓  A quick note on naming

Postgres Sync used to just be called "Electric" or the "Electric sync engine". Some docs and package names still use the old naming.

How does it work?

Postgres Sync connects to your Postgres using a DATABASE_URL, consumes the logical replication stream and fans out data into Shapes, which Clients then consume and sync.

Shape log flow diagram
Shape log flow diagram.

Technically, Postgres Sync is an Elixir application, developed at packages/sync-service. It runs as a seperate service, between your API and your database. Clients consume data over an HTTP API that works with CDNs to scale data delivery and fan-out.

Illustration of the main components of a successfull deployment

This allows you to have millions of concurrent users subscribing to real-time updates to your database with minimal additional load on your database.

More information

See the Quickstart, Docs and Demos.