Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to understand dqlite

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces you how to understand dqlite, the content is very detailed, interested friends can use for reference, hope to be helpful to you.

Dqlite is a C library that implements an embedded replicable SQL database engine with high availability and automatic failure recovery.

The name "dqlite" means "distributed SQLite", and dqlite extends SQLite. SQLite is mainly used standalone, while dqlite adds network protocol to link multiple application instances into a highly available cluster without relying on other external databases.

Kubernetes distributions that use dqlite include MicroK8s and K3s.

Main characteristics

Capabilities:

Fully synchronized network and disk Ibank O

Comprehensive test suite for correctness

Benchmarked for memory footprint and network efficiency

Persistent storage for transaction logs

Fast recovery for system restore

A stable Golang client with documentation containing wire protocol for implementation in other languages.

Support for ARM, X86, POWER and IBM Z architectures

Properties:

Ultra-low latency, C-Raft minimizes transaction delay.

Portability, C-Raft and dqlite are written in C language, providing multi-platform support.

Open source, licensed under Apache 2.0 for maximum compatibility.

Available, Includes common CLI pattern for database initialization and voting member joins and departures.

Quick failure response, Minimal, tunable delay for failover with automatic leader election.

Persistence, Disk-backed database with in-memory options and SQLite transactions.

Design features, Asynchronous single-threaded implementation using libuv as event loop.

Custom wire protocol, optimized SQLite primitives and data types.

Data replication, based on Raft algorithm and efficient C-raft implementation.

License

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.

Try out

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.

media

A talk about dqlite was given at FOSDEM 2020, you can watch it here.

Protocol-Wire protocol

If you wish to write a client, please refer to the wire protocol documentation.

Quick installation

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 source code construction

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 on how to understand dqlite to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report