Release of the distributed database rqlite 7.0 has taken place, which uses SQLite as its storage engine and allows the operation of a cluster of synchronized storage systems. rqlite is noted for its ease of installation, deployment, and maintenance of a distributed fault-tolerant storage solution, somewhat similar to etcd and Consul, but utilizing a relational data model instead of a key/value format. The project's code is written in Go and is distributed under the MIT license.
To maintain all nodes in a synchronized state, the Raft consensus algorithm is used. Rqlite utilizes the original SQLite library and the go-sqlite3 driver, above which sits a layer that processes client requests, performs replication to other nodes, and monitors the achievement of consensus for selecting a leader node.
Changes to the database can only be made by the node selected as the leader, but connections for write operations can also be directed to other nodes in the cluster, which will return the leader's address to retry the request (an automatic redirection to the leader is promised in the next version). The main focus is on fault tolerance, so the database is only scalable for read operations, while write operations are a bottleneck. It is possible to launch an rqlite cluster from a single node, and this solution can be used to provide access to SQLite over HTTP without offering fault tolerance.
SQLite data on each node is stored not in a file but in memory. At the layer implementing the Raft protocol, a log of all SQLite commands that lead to changes in the database is maintained. This log is used during replication (replication at the request playback level on other nodes), when launching a new node, or for recovery after a loss of connectivity. For reducing the log size, automatic packing is applied, which is initiated after a specified number of changes and results in a snapshot being recorded, relative to which a new log begins (the state of the database in memory is identical to the snapshot plus the accumulated change log).
Features of rqlite:
- Ease of deploying the cluster without needing a separate SQLite installation.
- Möjlighet att snabbt fÄ ett replikerat SQL-lager.
- Redo för anvÀndning i produktionsprojekt.
- TillgÄng till HTTP(S) API som möjliggör batchuppdatering av data och bestÀmning av ledande nod i klustret. Ett kommandoradsgrÀnssnitt och klientbibliotek för olika programmeringssprÄk tillhandahÄlls ocksÄ.
- TillgÄng till en tjÀnst för att identifiera andra noder, vilket möjliggör dynamisk skapande av kluster.
- Stöd för kryptering av datakommunikation mellan noder.
- Möjlighet att konfigurera nivÄn av giltighets- och konsistenskontroll vid lÀsning.
- Valfri möjlighet att koppla noder i skrivskyddat lÀge, som inte deltar i konsensusbestÀmningen och anvÀnds för att öka klustrets skalbarhet vid lÀsoperationer.
- Stöd för egendefinierade transaktionsformer baserade pÄ sammanslagning av kommandon i en förfrÄgan (transaktioner baserade pÄ BEGIN, COMMIT, ROLLBACK, SAVEPOINT och RELEASE stöds inte).
- Stöd för skapande av heta sÀkerhetskopior.
I den nya utgÄvan:
- Stöd för automatisk klustering av rqlite har lagts till med hjĂ€lp av en ny tjĂ€nst för nodidentifiering som kan fungera med distribuerade lagringslösningar som Consul och etcd. TjĂ€nsten gör att rqlite-noder automatiskt kan hitta varandra â administratören behöver bara starta flera noder pĂ„ olika servrar, genom att ange en gemensam adress för klustret Consul eller etcd (t.ex. "example.com:8500"), och noderna kommer automatiskt att kombineras i ett kluster. Den ledande noden uppdaterar regelbundet sin adress i Consul eller etcd, vilket gör att man senare kan Ă€ndra ledaren utan att behöva omkonfigurera övriga noder, samt lĂ€gga till nya noder Ă€ven efter en ledarĂ€ndring. Stödet för den gamla nodidentifieringstjĂ€nsten (Discovery mode), som fungerar pĂ„ AWS Lambda, har upphört.
- I CLI-grÀnssnittet tillÄts ange flera vÀrdar - om den första noden inte Àr tillgÀnglig kommer nÀsta vÀrd att kontaktas.
- Koden för att analysera kommandoradsargument i rqlited har omarbetats.
- AnvÀndning av det förÄldrade protobuf-paketet har upphört.
- Lagringslösningen BoltDB, som anvÀnds i implementeringen av Raft-protokollet, har ersatts av bbolt, en fork frÄn projektet etcd.
KĂ€lla: opennet.ru
