Build a real-time web app where users see database changes instantly without polling, by syncing a filtered PostgreSQL table to the browser.
Give an AI agent a live local copy of database rows it needs to reason over, without querying the database on every step.
Distribute live database data to thousands of clients at scale by placing Electric's HTTP sync protocol behind a CDN.
Define per-client Shapes so each user receives only the rows they are allowed to see, rather than syncing entire tables.
PostgreSQL must have logical replication enabled, Docker Compose setup is provided for local development.
Electric is a sync engine for PostgreSQL databases. Its job is to copy data out of a Postgres database and deliver it to clients in real time, keeping everything up to date as the database changes. The problem it addresses is that modern applications, particularly those built for speed and offline use, often need their own local copy of data rather than fetching everything from a server on each request. Setting up that kind of sync from scratch is complex: you have to decide what data each client should receive, handle changes as they happen, and do all of this without overloading the database or the network. Electric handles these concerns so application developers do not have to. The core of Electric is an HTTP-based sync protocol. Clients request a stream of data using a simple HTTP call, and Electric pushes updates as they occur. Because it uses standard HTTP, the delivery layer can be placed behind a CDN for large-scale distribution. Developers who prefer not to work directly with the HTTP protocol can use client libraries for TypeScript or React hooks like useShape, which subscribe to a subset of a table and update automatically when data changes. The subset of data a client receives is defined using a concept called Shapes. Rather than syncing an entire table to every client, you define a Shape that filters to the rows relevant to that client, which keeps data transfer manageable. Electric is positioned for both web applications and AI agent systems that need to operate on live database data. It connects to Postgres via a standard database URL and requires logical replication to be enabled on the database. The project is licensed under Apache 2.0 and provides a Docker Compose setup for local development.
← electric-sql on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.