dqlite is a C library for an embeddable, replicated SQL database with high availability and automatic failover. It extends SQLite across clustered application instances without external databases.
Overview
dqlite is a C library that implements an embeddable, replicated SQL database engine aimed at high availability and automatic failover. The name reflects distributed SQLite: a network protocol links multiple instances of your application so they act as a highly available cluster without relying on a separate database service.
Design highlights include a custom wire protocol tuned for SQLite primitives, and data replication using the Raft algorithm. The library can be linked statically in many projects under license terms that include a static-linking exception.
dqlite runs on Linux and expects a kernel with native async I/O. It targets fault-tolerant IoT and edge setups where a small SQLite footprint plus consensus matters. Documentation covers installation on Debian-based systems via a development PPA, operational utilities, and a wire protocol for custom clients.
Canonical’s materials emphasize C-Raft for transactional consensus, disk-backed persistence, a stable Go client, and support across several CPU architectures. CLI-style tooling supports cluster initialization and membership changes.
Key features
- Embeddable C library
- Raft-based replication
- SQLite-compatible SQL
- Automatic failover
- Custom wire protocol
- Fully asynchronous network and disk I/O
- Go client and documented protocol
- CLI patterns for cluster operations
Use cases
- Fault-tolerant edge appliances
- IoT devices needing local SQL
- Highly available embedded clusters
- Applications avoiding external databases