If you need a highly available database configuration where the loss of one node doesn’t result in loss of service and changes on one node are r

How to Setup Replicated Highly Available SQLite with rqlite - LowEndBox

submited by
Style Pass
2021-06-08 21:30:05

If you need a highly available database configuration where the loss of one node doesn’t result in loss of service and changes on one node are replicated to other nodes, you would probably reach for MariaDB, PostgreSQL, or one of the big boys like Oracle or SQL Server.  Probably the last thing that would cross your mind is sqlite.  After all, sqlite is not even multi-user, much less multi-node.

That’s very true for sqlite, but there’s a project called rqlite that adds both replication and high availability to SQLite, as well as other features such an an http(s) API, encrypted traffic, read-only nodes, and even hot backups.  It’s kind of the ultimate LowEndDatabase :-)

I’m going to use three VPSes for the cluster.  rqlite uses the RAFT consensus algorithm for high availability and replication, which means that you need to size your clusters in odd numbers – 3, 5, etc.

The first time you start rqlite, it won’t have any configuration information about the nodes, so we’ll start rqlite1 as the cluster leader and then manually join the other nodes.  In future starts/restarts, rqlite will know its config and we can start things in any order.

Leave a Comment