#sqlite #distributed #raft

bin+lib rxqlite

A secured distributed sqlite database built upon openraft, sqlx and sqlite

1 unstable release

0.1.24 May 11, 2024
0.1.23 May 3, 2024
0.1.22 Apr 26, 2024
0.1.11 Mar 28, 2024

#722 in Database interfaces



Rust 5.5K SLoC // 0.1% comments JavaScript 1K SLoC // 0.1% comments Shell 375 SLoC // 0.1% comments Batch 21 SLoC // 0.2% comments

Contains (WOFF font, 99KB) fontawesome-webfont.woff, (WOFF font, 78KB) fontawesome-webfont.woff2, (WOFF font, 45KB) open-sans-v17-all-charsets-300.woff2, (WOFF font, 41KB) open-sans-v17-all-charsets-300italic.woff2, (WOFF font, 45KB) open-sans-v17-all-charsets-600.woff2, (WOFF font, 43KB) open-sans-v17-all-charsets-600italic.woff2 and 7 more.


A secure distributed SQLite Database with notifications


You can compile rxqlited or use binaries built for Windows or Ubuntu (x86_64) on github available at: https://github.com/HaHa421/rxqlite/releases.

In case of binaries, be sure to use to use the latest version.

Windows: you need to use the msvc toolchain (mingw build is broken due to https://github.com/rust-rocksdb/rust-rocksdb/issues/866)


You will run rxqlited in cluster or in a single node mode, and since rxqlited uses the raft protocol, clusters must contain an odd number of nodes (rxqlited as a single node forms a cluster with only one node)

Starting a single node cluster on a local machine: using

rxqlited --id 1 --http-addr --rpc-addr --notifications-addr

rxqlited will listen on localhost:22001 for api and cluster management requests.

You can then get metrics from rxqlited using the following command:

curl http://localhost:21001/cluster/metrics

You should see the cluster current_leader as node 1, which is expected in a single node cluster.

Starting a 3 node cluster on a local machine:

rxqlited --id 1 --http-addr --rpc-addr --notifications-addr --member "2;;" --member "3;;" --leader true

rxqlited --id 2 --http-addr --rpc-addr --notifications-addr

rxqlited --id 3 --http-addr --rpc-addr --notifications-addr

will start three instances of rxqlited.

After a few seconds, we can check the cluster metrics using:

curl http://localhost:21001/cluster/metrics

and check that the cluster contains 3 nodes (membership : [1,2,3]).

Any subsequent cluster runs don't need to pass --member nor --leader when launching nodes

for further information on openraft you can check: https://github.com/datafuselabs/openraft

the client example shows a basic usage of the api using rust.

Furthermore, an sqlx driver is available from https://github.com/HaHa421/sqlx-rxqlite to ease the use of rxqlite using sqlx (https://github.com/launchbadge/sqlx)




WARNING: this database has not yet received any ITSA (Independent Third-party Security Audit)

This version of rxqlited supports tls in an insecure mode: It accepts invalid certificates (this includes self-signed certificates)


shows how to run the cluster in insecure tls mode.

It will generate a self signed certificate and private key in certs-test and will use this pair for all the nodes in the cluster (3 nodes here).

It then starts the three nodes with non tls parameters , adding --cert-path for the certificate path, --key-path for the private key path, --accept-invalid-certificates true. the parameter accept-invalid-certificates lets rxqlited accept invalid certificates.

Again, on subsequent cluster runs you dont need to pass all the initialisation parameters. One needs only to provide node_id (provided that the data dir is the default ./data-{node-id} which is not an option in the current release) as shown in ha-start-cluster.sh


Licensed under either of

at your option.


Unless you explicitly state otherwise, any Contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.


~2M SLoC