Electric BETA release | ElectricSQL
With version 1.0.0-beta.1
the Electric sync engine is now in BETA!
If you haven’t checked out Electric recently, it’s a great time to take another look.
What is Electric?
Electric is a Postgres sync engine. We do real-time partial replication of Postgres data into local apps and services.
Use Electric to swap out data fetching for data sync. Build apps on instant, real-time, local data. Without having to roll your own sync engine or change your stack.
We also develop PGlite, a lightweight WASM Postgres you can run in the browser.
The path to BETA
Six months ago, we took on a clean re-write.
First commit was on the 29th June 2024. 600 pull requests later, we’re ready for adoption into production apps.
Production ready
Electric and PGlite are being used in production by companies including Google, Supabase, Trigger.dev, Otto and Doorboost.
We use ElectricSQL to power Trigger.dev Realtime, a core feature of our product. When we execute our users background tasks they get instant updates in their web apps. It’s simple to operate since we already use Postgres, and it scales to millions of updates per day.
— Matt Aitken, Founder & CEO, Trigger.dev
At Otto, we built a spreadsheet product where every cell operates as its own AI agent. ElectricSQL enables us to reliably stream agent updates to our spreadsheet in real-time and efficiently manage large spreadsheets at scale. It has dramatically simplified our architecture while delivering the performance we need for cell-level reactive updates.
— Sully Omar, Co-founder & CEO, Otto
At Doorboost we aggregate millions of rows from a dozen platforms, all of which gets distilled down to a simple dashboard. With Electric we have been able to deliver this dashboard in milliseconds and update live. Moving forward, we will be building all our products using Electric.
— Vache Asatryan, CTO, Doorboost
Scalable
So many real-time sync systems demo well but break under real load.
Electric has been engineered from the ground up to handle high-throughput workloads, like Trigger.dev, with low latency and flat resource use. You can stream real-time data to millions of concurrent users from a single commodity Postgres.
The chart below is from our cloud benchmarks, testing Electric’s memory usage and latency with a single Electric service scaling real-time sync from 100k to 1 million concurrent clients under a sustained load of 960 writes/minute. Both memory usage and latency are essentially flat:
You can also see how large-scale apps built with Electric feel to use with our updated Linearlite demo. This is a Linear clone that loads 100,000k issues and their comments through Electric into PGlite (~150mb of data). Once loaded, it’s fully interactive and feels instant to use:
Easy to adopt
We’ve iterated a lot on our APIs to make them as simple and powerful as possible. There should be no breaking changes in minor or patch releases moving forward.
We’ve updated our Documentation, with a new Quickstart and guides for topics like:
We have client libraries, integration docs, demo apps and technical examples showing how to use Electric with different patterns and frameworks:
Interactive demos
Notes
Collaborative note-taking app with sync powered by Electric and Yjs.
Pixel art
Collaborative pixel art editor with real-time multiplayer editing.
Incrementally
You can adopt Electric one component and one route at a time. Wherever you have code doing something like this:
import React, { useState, useEffect } from 'react'
const MyComponent = () => {
const [items, setItems] = useState([])
useEffect(() => {
const fetchItems = async () => {
const response = await fetch('https://api.example.com/v1/items')
const data = await response.json()
setItems(data)
}
fetchItems()
}, [])
return (
<List items="items" />
)
}
Swap it out for code like this (replacing the fetch
in the useEffect
with useShape
):
import { useShape } from '@electric-sql/react'
const MyComponent = () => {
const { data } = useShape({
url: 'https://electric.example.com/v1/shapes',
params: {
table: 'items'
}
})
return (
<List items="data" />
)
}
This works with any Postgres data model and host, any data type, extension and Postgres feature. Including pgvector, PostGIS, sequential IDs, unique constraints, etc. You don’t have to change your data model or your migrations to use Electric.
With your existing API
Because Electric syncs over HTTP, you can use it together with your existing API.
This allows you to handle concerns like auth and writes with your existing code and web service integrations. You don’t need to codify your auth logic into database rules. You don’t need to replace your API endpoints and middleware stack.
Take another look
With this BETA release, Electric is stable and ready for prime time use. If you haven’t checked it out recently, it’s a great time to take another look.
Signup for early access to Electric Cloud
We’re also building Electric Cloud, which provides managed Electric hosting (for those that don’t want to host Electric themselves).
If you’re interested in using Electric Cloud, you can sign up for early access here: