Electrical (Postgres sync engine) beta release
With version 1.0.0-beta.1
the Electrical sync engine is now in BETA!
If you’ve not checked out Electrical lately, or no longer it’s a colossal time to protect one other seek.
What’s Electrical?
Electrical is a Postgres sync engine. We carry out actual-time partial replication of Postgres files into native apps and services.
Bellow Electrical to swap out files fetching for files sync. Produce apps on rapid, actual-time, native files. Without having to roll your beget sync engine or change your stack.
We additionally assemble PGlite, a delicate-weight WASM Postgres which it’s likely you’ll well maybe also creep in the browser.
The path to BETA
Six months previously, we took on a vivid re-write.
First commit used to be on the 29th June 2024. 600 pull requests later, we’re ready for adoption into production apps.
Production ready
Electrical and PGlite are being aged in production by companies at the side of Google, Supabase, Trigger.dev, Otto and Doorboost.
We spend ElectricSQL to energy Trigger.dev Realtime, a core characteristic of our product. When we assemble our users background tasks they uncover rapid updates of their web apps. Or no longer it’s uncomplicated to characteristic since we already spend Postgres, and it scales to thousands and thousands of updates per day.
— Matt Aitken, Founder & CEO, Trigger.dev
At Otto, we built a spreadsheet product where each and every cell operates as its beget AI agent. ElectricSQL enables us to reliably bound agent updates to our spreadsheet in actual-time and efficiently manage dapper spreadsheets at scale. It has dramatically simplified our architecture while turning in the efficiency we need for cell-stage reactive updates.
— Sully Omar, Co-founder & CEO, Otto
At Doorboost we mixture thousands and thousands of rows from a dozen platforms, all of which will get distilled down to a uncomplicated dashboard. With Electrical we had been able to bring this dashboard in milliseconds and replace are living. Appealing forward, we’ll be constructing all our products utilizing Electrical.
— Vache Asatryan, CTO, Doorboost
Scalable
So many actual-time sync systems demo smartly but fracture underneath actual load.
Electrical has been engineered from the floor up to address high-throughput workloads, love Trigger.dev, with low latency and flat helpful resource spend. You might maybe well also bound actual-time files to thousands and thousands of concurrent users from a single commodity Postgres.
The chart underneath is from our cloud benchmarks, testing Electrical’s memory utilization and latency with a single Electrical carrier scaling actual-time sync from 100k to 1 million concurrent purchasers underneath a sustained load of 960 writes/minute. Each memory utilization and latency are in actual fact flat:
You might maybe well also additionally detect how dapper-scale apps built with Electrical feel to spend with our updated Linearlite demo. Here is a Linear clone that loads 100,000k points and their comments thru Electrical into PGlite (~150mb of files). As soon as loaded, or no longer it’s absolutely interactive and feels rapid to spend:
Easy to adopt
We have iterated loads on our APIs to design them as uncomplicated and sturdy as likely. There desires to be no breaking adjustments in minor or patch releases bright forward.
We have updated our Documentation, with a fresh Quickstart and guides for issues love:
- how which it’s likely you’ll well maybe also carry out auth
- how which it’s likely you’ll well maybe also care for native writes
- how which it’s likely you’ll well maybe also carry out partial replication with Shapes
- how which it’s likely you’ll well maybe also deploy Electrical
- how which it’s likely you’ll well maybe also write your beget consumer for any language or environment
We luxuriate in consumer libraries, integration doctors, demo apps and technical examples exhibiting how which it’s likely you’ll well maybe also spend Electrical with diverse patterns and frameworks:
Interactive demos
Incrementally
You might maybe well also adopt Electrical one part and one route at a time. Wherever which it’s likely you’ll well maybe even luxuriate in got code doing something love this:
tsx
import React, { useState, useEffect } from 'react'
const MyComponent = () => {
const [items, setItems] = useState([])
useEffect(() => {
const fetchItems = async () => {
const response = no longer sleep for gather('https://api.instance.com/v1/items')
const files = no longer sleep for response.json()
setItems(files)
}
fetchItems()
}, [])
return (
<List items={ items } />
)
}
Swap it out for code love this (replacing the gather
in the useEffect
with useShape
):
tsx
import { useShape } from '@electric-sql/react'
const MyComponent = () => {
const { files: items } = useShape({
url: 'https://electric.instance.com/v1/shapes',
params: {
table: 'items'
}
})
return (
<List items={ items } />
)
}
This works with any Postgres files model and host, any files form, extension and Postgres characteristic. Including pgvector, PostGIS, sequential IDs, ordinary constraints, etc. It is best to no longer prefer to alter your files model or your migrations to spend Electrical.
With your existing API
Ensuing from Electrical syncs over HTTP, which it’s likely you’ll well maybe also spend it together with your existing API.
This allows you to address considerations love auth and writes with your existing code and web carrier integrations. You do no longer prefer to codify your auth common sense into database ideas. You do no longer prefer to change your API endpoints and middleware stack.
Purchase one other seek
With this BETA release, Electrical is staunch and ready for prime time spend. If you’ve not checked it out lately, or no longer it’s a colossal time to protect one other seek.
Signup for early uncover admission to to Electrical Cloud
We’re additionally constructing Electrical Cloud, which affords managed Electrical web hosting (for folks that don’t prefer to host Electrical themselves).
If which it’s likely you’ll well maybe also very smartly be attracted to utilizing Electrical Cloud, which it’s likely you’ll well maybe also be a part of early uncover admission to here: