DBDB.io The Encyclopedia of Database Systems · Est. 2017
Database of Databases

Database Entry

rqlite


rqlite is a lightweight, distributed DBMS which uses SQLite as its storage engine. rqlite uses the Raft protocol to achieve consensus across multiple instances of the SQLite database, ensuring that every change made to the system is made to a quorum of SQLite databases, or none at all.[04]

Source Code
https://github.com/rqlite/rqlite[02]
Developer
Country of Origin
US
Start Year
2014 [06]
Project Type
Open Source
Written in
Go
Embeds / Uses
SQLite
Operating Systems
Linux, macOS, Windows
License
MIT License

Database Entry

rqlite


rqlite is a lightweight, distributed DBMS which uses SQLite as its storage engine. rqlite uses the Raft protocol to achieve consensus across multiple instances of the SQLite database, ensuring that every change made to the system is made to a quorum of SQLite databases, or none at all.[04]

History[05][06]


rqlite was originally a prototype application, showing how the Raft consensus algorithm could be applied to various software state machines -- in this particular instance a SQLite database.

It has since developed into a full relational database management system.

Concurrency Control


rqlite can service multiple queries concurrently, but actual concurrency depends on the underlying SQLite functionality.

Data Model


rqlite supports the relational data model, since it uses SQLite as its storage engine.

Foreign Keys[07]


Since rqlite uses SQLite as its storage engine, it can make full use of SQLite Foreign Key support.

Indexes[08][09][10][11]


Since rqlite uses SQLite as its storage engine, it can make full use of SQLite Indexes

Isolation Levels[12]


Since rqlite uses SQLite as its storage engine, it offers the same isolation levels as SQLite.

Joins[13]


Since rqlite uses SQLite as its storage engine, it performs Joins in the same manner as SQLite, within a single rqlite node. It is important to note however, that even though rqlite supports clustering, it does not support Joins across rqlite nodes in that cluster.

Logging


rqlite provides data durability via the Raft consensus system. Every change made to the SQLite database is written to the Raft log, and that log is persisted to disk. In the event of a restart or recovery operation, the SQLite database is completely rebuilt from the data contained in the Raft log.

Query Interface[14][15]


rqlite is primarily queried via its HTTP(S) API. A query is formed by encapsulating a SQL statement in a HTTP request. And when using the "on disk" mode of rqlite, the SQLite database can also be queried directly.

Storage Architecture[16]


rqlite supports both in-memory and disk-oriented storage. The SQLite database can be stored on disk, or in memory. The Raft log is stored on disk.

Storage Model


Since rqlite uses SQLite as its storage engine, it offers the same storage model as SQLite.

Stored Procedures[17]


Since SQLite does not offer Stored Procedures, neither does rqlite.

System Architecture[18]


rqlite's system architecture is comprised of 3 distinct subsystems: the HTTP serving layer, the Raft consensus layer, and the (embedded) SQLite database.

The HTTP layer is responsible for responding to queries, and returning results. The Raft consensus layer controls communication between nodes, implementing the distributed consensus system. Once a change to the database has been committed to the Raft log on each node, each node then makes the change to the last subsystem, which is the embedded SQLite database.

Views[19]


rqlite offers the same Views support as SQLite.

Citations

22 sources
  1. rqlite rqlite.io
  2. GitHub - rqlite/rqlite: The lightweight, fault-tolerant database built on SQLite. Designed to keep your data highly available with minimal effort. · GitHub github.com
  3. Docs | rqlite rqlite.io
  4. rqlite/README.md at master · rqlite/rqlite · GitHub github.com
  5. rqlite at the San Francisco Go Meetup – Philip O'Toole philipotoole.com
  6. Replicating SQLite using Raft Consensus – Philip O'Toole philipotoole.com
  7. SQLite Foreign Key Support sqlite.org
  8. The SQLite R*Tree Module sqlite.org
  9. Partial Indexes sqlite.org
  10. Indexes On Expressions sqlite.org
  11. Database File Format sqlite.org
  12. Isolation In SQLite sqlite.org
  13. The Next-Generation Query Planner sqlite.org
  14. Replicating SQLite with rqlite | Simon Willison’s TILs simonwillison.net
  15. https://github.com/rqlite/rqlite/blob/master/DOC/DATA_API.md github.com Dead — Check Archive
  16. https://github.com/rqlite/rqlite/blob/master/DOC/DESIGN.md github.com Dead — Check Archive
  17. Appropriate Uses For SQLite sqlite.org
  18. rqlite: replicating SQLite using Raft Consensus - Google Slides google.com
  19. Temporary Files Used By SQLite sqlite.org
  20. https://github.com/rqlite/rqlite/commit/852f730065a850a452dbca142a46fa076e3c883b github.com
  21. https://github.com/rqlite/rqlite/commit/f6078843344d6135f97d5d6613e9a0586ba43c1f github.com
  22. https://github.com/rqlite/rqlite/commit/f42a3115b652c2657c7459c3890451b1136e4ebc github.com
Revision #15 Last Updated: