🗃️ Databases Intermediate

Electric

by electric-sql

ElectricSQL: Local-First Postgres Sync with CRDTs

Build responsive apps with automatic Postgres-to-SQLite sync, enabling offline-first experiences with conflict-free real-time data replication.

9,811 Stars
305 Forks
9,811 Watchers
222 Issues
🗃️

About This Project

ElectricSQL transforms PostgreSQL into a distributed, local-first database system by syncing data bidirectionally between your Postgres server and embedded SQLite databases in client applications. This architecture enables developers to build ultra-responsive applications that work seamlessly offline and sync automatically when connectivity returns.

The framework leverages Conflict-free Replicated Data Types (CRDTs) to handle concurrent edits across multiple clients without complex merge logic. Your application queries local SQLite for instant reads and writes, while ElectricSQL manages the sophisticated replication layer in the background, ensuring eventual consistency across all connected devices.

Built with Elixir for robust concurrency handling, ElectricSQL provides a complete solution for modern app architectures that demand both real-time collaboration and offline resilience. It eliminates the need to build custom sync logic, handle conflict resolution manually, or compromise on user experience during network interruptions.

Whether you're building collaborative tools, mobile apps with offline requirements, or distributed systems that need edge computing capabilities, ElectricSQL provides the infrastructure to keep data synchronized reliably across any number of clients and your central Postgres database.

Key Features

  • Bidirectional real-time sync between PostgreSQL and SQLite databases
  • CRDT-based conflict resolution for automatic merge of concurrent edits
  • Offline-first architecture with instant local reads and writes
  • Built on Elixir for reliable, fault-tolerant replication infrastructure
  • Seamless integration with existing Postgres schemas and applications

How You Can Use It

1

Building mobile apps that need full offline functionality with automatic cloud sync

2

Creating collaborative tools where multiple users edit shared data simultaneously

3

Developing edge computing applications that process data locally and sync to central servers

4

Implementing real-time dashboards with instant local queries and live updates

5

Building progressive web apps with native-like performance and offline capabilities

Who Is This For?

Full-stack developers and teams building local-first, offline-capable, or real-time collaborative applications with PostgreSQL