https://electric-sql.com/
Skip to main content
DocsBlogAbout
Discord
Star on GitHub GitHub
The missing sync layer for modern apps
Build reactive, realtime, local-first apps directly on Postgres.
Quickstart >> Star ( 1,303 )
* Access rules
* Sync shapes
* Live queries
* Local writes
Authorize and control Control data access with row-level DDLX rules.
Electrify tables to opt them in to sync. Then grant and assign
permissions using your existing data model.
ALTER TABLE projects
ENABLE ELECTRIC;
ELECTRIC ASSIGN 'projects:owner'
TO projects.owner_id;
ELECTRIC GRANT ALL
ON projects
TO 'projects:owner';
ELECTRIC GRANT SELECT
ON projects
TO ANYONE;
Craft how data syncs on and off onto your app using Shapes.
Shapes allow you to manage dynamic partial replication between
Postgres in the cloud and SQLite in the local app.
const shape = await db.projects.sync({
where: {
owner_id: auth.user_id
},
include: {
issues: {
include: {
comments: {
include: {
author: true
}
}
}
}
}
});
Bind realtime data to your components with Live queries.
Queries are type-safe, reactive and run purely against data synced
onto the local SQLite, with 100% full SQL support.
const MyComponent = () => {
const db = useElectric()!
const { results } = useLiveQuery(
db.projects.liveMany({
where: {
status: true
},
orderBy: {
name: 'asc'
}
})
)
return (
)
}
Take the network off the interaction path with Local writes.
No need for a state management library. Writes are immediate,
reactive, replicated and conflict-free.
const MyComponent = () => {
const db = useElectric()!
const { results } = useLiveQuery(
db.projects.liveMany()
)
const add = () => {
db.projects.create({
data: {
id: crypto.randomUUID()
}
})
}
return (
)
}
[anurag]
Anurag Goel
Founder - Render
ElectricSQL is a great choice for a local-first sync layer that you
can run anywhere yourself.
[johannes]
Johannes Schickling
Founder - Prisma
I'm very impressed with ElectricSQL's approach to sync and their
thoughtful API design.
[jose]
Jose Valim
Creator - Elixir
ElectricSQL brings the full power of the Erlang VM to local-first
software development.
For
Modern UX
* Instant reactivity
* Realtime multi-user
* Conflict-free offline
Local-first data access makes your apps instantly responsive and
consistently fast.
Realtime multi-user replication keeps your data in sync between users
and devices.
Conflict-free offline solves connectivity and concurrency issues for
you using CRDTs, Rich-CRDTs and strong eventual consistency.
For
Operational simplicity
* Simple to operate
* Cheaper to run
* Reliable by design
Reduce the diversity and workload of your backend services by
standardising on a simple, scalable replication protocol.
[backend-se]
[arrow-righ][arrow-down]
[app-icon]
Move data and compute workload onto the local device for a
huge reduction in your cloud compute bill.
Queries
Database queries
per second
[31.622776601683793 ]
1,000
Workload
Percentage of
workload reduced
[85 ]
85%
Cost saving?
Monthly compute
cost saved
$18,727
Local-first apps naturally tolerate network and backend downtime, so
you don't need to engineer such high uptime.
Downtime
Time per
month
[1 ]
3 hours
System
Actual
reliability
99.5%
End-user
Target
reliability
[3 ]
99.999%
Cost saving?
Reliability
engineering
300x
Using
Your existing stack
* Standard open-source
* Drop-in compatible
* Existing applications
Permissive license. No operational lock-in. Works with any
Postgres-based system.
[open-sourc]
Open source
Apache 2.0 license. Open development on GitHub and Discord.
Contributions welcome.
[self-host]
Self-host
One horizontally scalable sync service. No complex infra or
durability requirements.
[postgres]
Any Postgres
Works with your existing data model and any Postgres that supports
logical replication.
Works with your existing data model, migrations tooling,
web framework and component library.
Database
* [postgres]Postgres
* [aurora]Aurora
* [alloy]AlloyDB
* [crunchy]Crunchy
* [elephant]ElephantSQL
Backend
* [phoenix]Phoenix
* [prisma]Prisma
* [rails]Rails
* [python]SQLAlchemy
* [laravel]Laravel
Frontend
* [react]React
* [react-nati]React Native
* [expo]Expo
* [vue]Vue
* [solid]Solid
Deployment
* [docker]Docker
* [k8s]Kubernetes
* [fly]Fly.io
* [deploy]Other
Designed to provide an incremental adoption pathway for your existing
brownfield applications.
[rest]
Switch from REST
Swap out your REST API endpoints for ElectricSQL and you'll never
need to code imperative state transfer again.
Find out how >>
[redux]
Switch from Redux
You don't need a state management framework when you can code
directly against a local reactive database.
Find out how >>
[graphql]
Switch from GraphQL
Swap out your GraphQL layer for ElectricSQL for realtime multi-user
and local-writes without rollbacks.
Find out how >>
Next steps
Get started
Jump into the Quickstart guide for the fastest way to get ElectricSQL
up and running. Or checkout the Examples and the Usage and
Integration guides.
Quickstart >>Usage guideIntegrations
Join the community
Join our community Discord and star us on GitHub to support
the project.
[6399322][13395944][97369296][17374][128885][1634427]
[284820][5748289][628430][41403842][54708991][30302]
Join Discord >> Star ( 1,303 )
Become a design partner
Collaborate with the ElectricSQL team to build local-first
applications.
[splash]
Apply now >> Get in touch
Docs
* Docs
* Introduction
* Quickstart
* Examples
* Usage
* API
About
* About
* Community
* Enterprise
* Team
* Jobs
* Contact
Social
* Social
* GitHub
* Discord
* Mastodon
* Twitter
* LinkedIn
[logo][logo]
(c) 2023 Electric DB Limited. Cookies - Privacy - Terms.
Code and docs Apache 2.0 license.
Cookies - Privacy - Terms.