|Dqlite extends SQLite To Clusters|
|Written by Kay Ewbank|
|Monday, 02 September 2019|
A distributed database that extends SQlite across clusters of machines has recently been updated to a 1.0 branch.
Dqlite (“distributed SQLite”) extends SQLite across a cluster of machines, with automatic failover and high-availability. It uses C-Raft, an optimized Raft implementation in C, to gain high-performance transactional consensus and fault tolerance while preserving SQlite’s efficiency and tiny footprint. SQLite is the world’s most widely used embedded SQL implementation.
Dqlite has an asynchronous single-threaded implementation using libuv as the event loop, and the developers have implemented a custom wire protocol optimized for SQLite primitives and data types.
The highest profile user of Dqlite is the LXD (LinuX Daemon) system containers manager, which uses dqlite to implement high-availability when run in cluster mode.
C-Raft is a hand-tuned C implementation of Raft, a consensus algorithm. Consensus algorithms ensure data persistence in the event of the loss of one or more machines in the cluster, as long as a majority survives.
Dqlite was originally implemented in Go, but has been rewritten in C because the developers at Canonical encountered performance problems due to the way Go interoperates with C: Go considers a function call into C that lasts more than 20 microseconds as a blocking system call. The goroutine running that C call is therefore put in the waiting queue and resuming it will causes a context switch, degrading performance.
The developers say that Dqlite offers fully asynchronous network and disk I/O, and persistent storage to disk for transaction logs. It has been benchmarked for memory footprint and network efficiency, and offers fast recovery for system restore. It runs on ARM, X86, POWER and IBM Z architectures, but at the moment doesn't support either Windows or MacOS. There's a stable Golang client and a documented wire protocol for other languages.
or email your comment to: firstname.lastname@example.org
|Last Updated ( Monday, 02 September 2019 )|