dqlite

active

by Canonical · since 2017 · also known as distributed SQLite

Canonical's embeddable C library that makes SQLite highly available with Raft replication.

relationalembedded libraryopen source (copyleft)mature

Overview

dqlite (distributed SQLite) is a C library from Canonical that embeds a replicated SQL engine directly in your application: instances of the app form a Raft cluster and keep identical SQLite databases, with automatic leader election and failover and no external database to operate. It uses libuv and a custom wire protocol tuned for SQLite primitives, and Canonical ships it inside LXD and MicroK8s (where it replaces etcd as the Kubernetes datastore via kine). A Go binding (go-dqlite) is the main way to use it. It is a specialist building block for clustered infrastructure software rather than a standalone database server.

Strengths & trade-offs

Strengths

  • +Embedded HA SQL with no separate database process
  • +Raft-based automatic failover and leader election
  • +Proven inside LXD and MicroK8s clusters
  • +SQLite semantics and SQL dialect
  • +Small footprint suitable for edge appliances

Trade-offs

  • −Linux-only
  • −Go is the only first-class high-level binding
  • −Write throughput bounded by a single Raft leader
  • −Small community outside Canonical's own products

Great for

  • +Cluster state for infrastructure software (LXD, MicroK8s)
  • +Kubernetes datastore replacement for etcd via kine
  • +HA configuration stores in edge appliances
  • +Embedding a replicated database in Go services

Think twice for

  • −Large datasets or high write rates
  • −Non-Linux platforms
  • −Teams wanting a standalone database server

Capabilities

Native or official first-party support · 6 of 25 tracked

✓Transactions
✓Joins
✓Secondary indexes
✓JSON
✓Triggers
✓Durable persistence
–Full-text search
–Vector search
–Geospatial
–Change data capture
–Stored procedures
–Materialized views
–TTL / expiry
–Pub/Sub
–Columnar storage
–In-memory
–Compression
–Encryption at rest
–Role-based access
–Time travel
–Branching
–Online schema changes
–Streaming ingest
–Offline sync
–Runs in WebAssembly

Scale & consistency

Comfortable data size
Small · ≤ 100 GB
Horizontal scaling
None
Multi-region
No
Transactions
Full ACID
Consistency
Strong
Schema
Flexible
Architecture
Embedded, Distributed
Query languages
SQL

Small Raft clusters (3-5 voters) inside an application; each node holds the full database.

Deployment

Self-hosted Vendor-managed cloud Serverless Embedded Edge Kubernetes operator

Ecosystem

compatible withSQLite
apis & protocolsdqlite wire protocol, C API, Go database/sql driver
client languagesC, Go, Python

Alternatives to dqlite

Compare all→
rqliteRelational14.5

Lightweight distributed database that replicates SQLite over Raft behind a simple HTTP API.

dqlite vs rqlite →
SQLiteRelational75.5

The in-process SQL engine that ships in every phone, browser and OS: one file, zero servers.

dqlite vs sqlite →
etcdKey-Value32.4

Raft-based, strongly consistent key-value store that holds Kubernetes' cluster state.

dqlite vs etcd →
libSQLRelational29.1

Turso's open-contribution SQLite fork with native vectors, a network server and embedded replicas.

dqlite vs libsql →
CockroachDBRelational47.1

Postgres-wire distributed SQL built to survive node, zone and region failures with serializable transactions.

dqlite vs cockroachdb →
Mimer SQLRelational8.6

Swedish standards-strict SQL engine built for embedded, automotive and real-time systems.

dqlite vs mimer-sql →

dqlite FAQ

What is dqlite?

dqlite is a relational database by Canonical, first released in 2017. dqlite (distributed SQLite) is a C library from Canonical that embeds a replicated SQL engine directly in your application: instances of the app form a Raft cluster and keep identical SQLite databases, with automatic leader election and failover and no external database to operate. It uses libuv and a custom wire protocol tuned for SQLite primitives, and Canonical ships it inside LXD and MicroK8s (where it replaces etcd as the Kubernetes datastore via kine). A Go binding (go-dqlite) is the main way to use it. It is a specialist building block for clustered infrastructure software rather than a standalone database server.

Is dqlite open source?

Yes. dqlite is open source. License: LGPL-3.0 with static-linking exception.

Does dqlite support ACID transactions?

Yes. dqlite supports full ACID transactions, with strong consistency.

Does dqlite scale horizontally?

dqlite does not scale horizontally; it runs on a single node, so you scale it up rather than out. It is comfortable at small scale (≤ 100 GB).

How can I run dqlite?

You can self-host it, embed it in your application and run it at the edge.

What is dqlite best for?

dqlite is a strong fit for cluster state for infrastructure software (LXD, MicroK8s); kubernetes datastore replacement for etcd via kine; and HA configuration stores in edge appliances. Think twice for large datasets or high write rates.

What are the best alternatives to dqlite?

Common alternatives to dqlite include rqlite, SQLite, etcd, libSQL and CockroachDB. The right choice depends on your workload, scale and hosting; WhichDB's smart match ranks them against your requirements.

How popular is dqlite?

dqlite ranks #324 of 844 databases on the WhichDB Score (8.4/100), and #105 among relational databases. The score combines public adoption signals such as package downloads, GitHub activity, job posts and developer discussion.