data-storage / app
Electric
Capability: Electric
Use it when
- Your frontend polls REST endpoints to keep client state fresh and you want live partial replication out of Postgres over a plain HTTP API instead of building a websocket fanout layer.
- You are building local-first or realtime features (dashboards, collaborative views, agents on live data) and need scalable read-path sync from Postgres that can sit behind a CDN.
What it solves
Not the fit when
- write-path sync; Electric is a read-path sync engine
- Postgres without logical replication enabled
- the optional LiveDashboard port is completely unauthenticated; never expose it publicly
- client to postgres write path and conflict resolution
- database schema migrations
- syncing from databases other than postgres
Install
docker compose -f .support/docker-compose.yml up # from the repo root; requires Postgres with logical replication enabled, connected via DATABASE_URL
Invoke
curl -i 'http://localhost:3000/v1/shape?table=foo&offset=-1' to sync a table over HTTP, or consume via the TypeScript client / React useShape hook with a table and optional where clause.
Alternatives
No reviewed alternatives recorded yet.