您好,登錄后才能下訂單哦!
這篇文章給大家介紹如何理解dqlite,內容非常詳細,感興趣的小伙伴們可以參考借鑒,希望對大家能有所幫助。
dqlite是一個 C library,實現了一個嵌入式的可復制SQL database engine,具有高可用和自動失效恢復的特性。
名稱 "dqlite" 意味著 "distributed SQLite",是 dqlite 擴展了 SQLite 而來。SQLite主要單機使用,而dqlite添加了 network protocol可以將多個應用實例鏈接為一個高可用的集群,而且不需要依賴其他的外部數據庫。
使用dqlite的Kubernetes分發版包括MicroK8s和K3s。
能力:
完全同步的 network 和 disk I/O
Comprehensive test suite for correctness
Benchmarked for memory footprint and network efficiency
持久化存儲用于transaction logs
快速恢復,用于system restore
穩定的 Golang 客戶端,文檔包含 wire protocol 用于其它語言的實現。
支持 ARM, X86, POWER 和 IBM Z architectures
特性:
超低時延,C-Raft 最小化交易延遲。
移植性,C-Raft 和 dqlite 都用c語言編寫,提供多平臺支持。
開源,采用Apache 2.0 許可,最大的兼容性。
可用,Includes common CLI pattern for database initialization and voting member joins and departures.
快速失效回復,Minimal, tunable delay for failover with automatic leader election.
持續性,Disk-backed database with in-memory options and SQLite transactions.
設計特性,Asynchronous single-threaded implementation using libuv as event loop.
自定義的wire protocol,優化了SQLite primitives 和 data types.
數據復制,基于 Raft algorithm 和高效的 C-raft 實現。
The dqlite library is released under a slightly modified version of LGPLv3, that includes a copyright exception letting users to statically link the library code in their project and release the final work under their own terms. See the full license text.
The simplest way to see dqlite in action is to use the demo program that comes with the Go dqlite bindings. Please see the relevant documentation in that project.
A talk about dqlite was given at FOSDEM 2020, you can watch it here.
If you wish to write a client, please refer to the wire protocol documentation.
If you are on a Debian-based system, you can the latest stable release from dqlite's stable PPA:
sudo add-apt-repository ppa:dqlite/stable sudo apt-get update sudo apt-get install libdqlite-dev
To build libdqlite
from source you'll need:
A reasonably recent version of libuv (v1.8.0 or beyond).
A patched version of SQLite with support for WAL-based replication.
A build of the C-raft Raft library.
A build of the libco coroutine library.
Your distribution should already provide you a pre-built libuv shared library.
To build the other libraries:
git clone --depth 100 https://github.com/canonical/sqlite.git cd sqlite ./configure --enable-replication make sudo make install cd .. git clone https://github.com/canonical/libco.git cd libco make sudo make install cd .. git clone https://github.com/canonical/raft.git cd raft autoreconf -i ./configure make sudo make install cd ..
Once all required libraries are installed, to in order to build the dqlite shared library itself you can run:
autoreconf -i ./configure make sudo make install
關于如何理解dqlite就分享到這里了,希望以上內容可以對大家有一定的幫助,可以學到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。