千家信息网

如何理解dqlite

发表于:2026-11-01 作者:千家信息网编辑
千家信息网最后更新 2026年11月01日,这篇文章给大家介绍如何理解dqlite,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。dqlite是一个 C library,实现了一个嵌入式的可复制SQL database en
千家信息网最后更新 2026年11月01日如何理解dqlite

这篇文章给大家介绍如何理解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.

协议-Wire protocol

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/stablesudo apt-get updatesudo 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.gitcd sqlite./configure --enable-replicationmakesudo make installcd ..git clone https://github.com/canonical/libco.gitcd libcomakesudo make installcd ..git clone https://github.com/canonical/raft.gitcd raftautoreconf -i./configuremakesudo make installcd ..

Once all required libraries are installed, to in order to build the dqlite shared library itself you can run:

autoreconf -i./configuremakesudo make install

关于如何理解dqlite就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。

特性 内容 数据 更多 语言 帮助 支持 不错 最大 最小 兴趣 兼容性 单机 可复制 名称 多个 媒体 实例 客户 客户端 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 互联网为科技 金融科技与互联网金融 互联网科技公司发展 互联网科技视频 唐信互联网科技 大连 左右互联网络科技 青海省互联网新科技 宁波青枫互联网科技有限公司 互联网企业和科技型企业 湖北码尼互联网科技有限公司电话 宜昌元轩互联网科技有限公司 迪庆互联网科技招生 东莞新华互联网科技学校 中和天地互联网科技有限公司 深圳互联网科技的发展 互联网科技实习生岗位 广州百诚互联网科技有限公司官网 江苏互联网智能科技软件 绵阳真晨互联网科技有限公司 六子台科技互联网展会 广州淘业互联网络科技 北京互联网络科技有限公司 互联网科技素材视频竖屏 天速互联网络科技有限公司 移动互联网科技股 华服互联网科技官网 南博望互联网科技有限公司 山东星卡互联网科技有限公司官网 全球科技与互联网公司市值变化 陕西九四连强互联网科技有限公司
0