Show HN: ElectricSQL, Postgres to SQLite active-active sync for local-first apps (electric-sql.com)
recommended by 2 users | 2023 | 56 points by samwillis | distributed systems | original thread |

Hi HN, James, Valter, Sam and the team from ElectricSQL here.

We're really excited to be sharing ElectricSQL with you today. It's an open source, local-first sync layer that can be used to build reactive, realtime, offline-capable apps directly on Postgres with two way active-active sync to SQLite (including with WASM in the browser).

Electric comprises a sync layer (built with Elixir) placed in front of your Postgres database and a type safe client that allows you to bidirectionally sync data from your Postgres to local SQLite databases. This sync is CRDT-based, resilient to conflicting edits from multiple nodes at the same time, and works after being offline for extended periods.

Some good links to get started:

- website: https://electric-sql.com

- docs: https://electric-sql.com/docs

- code: https://github.com/electric-sql/electric

- introducing post: https://electric-sql.com/blog/2023/09/20/introducing-electri...

You can also see some demo applications:

- Linear clone: https://linear-lite.electric-sql.com

- Realtime demo: https://electric-sql.com/docs/intro/multi-user

- Conflict-free offline: https://electric-sql.com/docs/intro/offline

The Electric team actually includes two of the inventors of CRDTs, Marc Shapiro and Nuno Preguiça, and a number of their collaborators who've pioneered a lot of tech underpinning local-first software. We are privileged to be building on their research and delighted to be surfacing so much work in a product you can now try out.

2 users recommended this thread. What they said:
obeavs Dec 1, 2023 | on: SQLSync – Stop Building Databases | context

ElectricSQL has made massive strides towards solving this fwiw. Write sqllite in client, guarantee sync to postgres.

See: https://news.ycombinator.com/item?id=37584049

jauntywundrkind Sep 25, 2025 | on: Immich mobile app sync V2 | context

Nice:

> Having just migrated to Kysely from TypeORM, we were already seeing massive improvements with regard to speed and memory usage in other parts of the application as we migrated queries to use the streaming interface (see #16600, #16666, #16700, #16706, etc.).

I would generally suggest folks look at something like ElectricSQL Postgres Sync Engine. There's a pretty good ShapeStream HTTP API for shipping shape logs across to the client. It can do so much of the heavy lifting for shipping updates for you, & will be reliable! https://electric-sql.com/docs/api/clients/typescript#shapest...

ElectricSQL are also authors of pglite, a wasm postgres, for running a sync-ed to mini postgres on the client (via wasm). https://news.ycombinator.com/item?id=37584049 https://news.ycombinator.com/item?id=41224689