vlcn-io/cr-sqlite logo

vlcn-io/cr-sqlite

Free

Convergent, Replicated SQLite. Multi-writer and CRDT support for SQLite

FreeFree tier
Type
Open Source
Company
vlcn-io

About vlcn-io/cr-sqlite

CR-SQLite is a run-time loadable extension for SQLite and libSQL that adds multi-master replication and partition tolerance via Conflict-Free Replicated Data Types (CRDTs) and causally ordered event logs. It allows merging SQLite databases that have taken independent writes, enabling offline editing, real-time collaboration, and data syncing across devices without requiring custom application code for conflict resolution. It provides SQL APIs to upgrade tables to conflict-free replicated relations, retrieve and apply changesets, and alter table schemas.

Key Features

Multi-master replication and partition tolerance for SQLite
Conflict-Free Replicated Data Types (CRDTs) for automatic conflict resolution
Causally ordered event logs for merging independent edits
Run-time loadable extension for SQLite and libSQL
SQL APIs: crsql_as_crr to upgrade tables, crsql_changes for changesets, crsql_begin_alter and crsql_commit_alter for schema changes
Supports offline editing, real-time collaboration, and data syncing across devices

Pros & Cons

Pros
  • Open source and free to use
  • No need for custom application-level conflict resolution code
  • Works seamlessly with existing SQLite databases
  • Supports real-time collaboration and offline-first architectures
  • Active community and sponsors (e.g., Meta, Muse, notion, Cloudflare)
Cons
  • Inserts into conflict-free replicated relations are approximately 2.5x slower than regular SQLite tables
  • Requires understanding of CRDT concepts for advanced use
  • Limited to SQLite ecosystem; not a full database server

Best For

Syncing data between devicesImplementing realtime collaborationOffline editing with automatic conflict resolutionBeing resilient to network conditionsEnabling instantaneous interactions in local-first applications