Giter Site home page Giter Site logo

ljluestc / dqlite Goto Github PK

View Code? Open in Web Editor NEW

This project forked from canonical/dqlite

0.0 0.0 0.0 2.58 MB

Embeddable, replicated and fault tolerant SQL engine.

Home Page: https://dqlite.io

License: Other

Shell 0.08% C 91.82% Emacs Lisp 0.02% Makefile 0.38% M4 7.55% Dockerfile 0.15%

dqlite's Introduction

dqlite CI Tests codecov

English|简体中文

dqlite is a C library that implements an embeddable and replicated SQL database engine with high availability and automatic failover.

The acronym "dqlite" stands for "distributed SQLite", meaning that dqlite extends SQLite with a network protocol that can connect together various instances of your application and have them act as a highly-available cluster, with no dependency on external databases.

Design highlights

  • Asynchronous single-threaded implementation using libuv as event loop.
  • Custom wire protocol optimized for SQLite primitives and data types.
  • Data replication based on the Raft algorithm and its efficient C-raft implementation.

License

The dqlite library is released under a slightly modified version of LGPLv3, that includes a copyright exception allowing users to statically link the library code in their project and release the final work under their own terms. See the full license text.

Compatibility

dqlite runs on Linux and requires a kernel with support for native async I/O (not to be confused with POSIX AIO), which is used by the libuv backend of C-raft.

Try it

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.

Here is a blog post from 2022 comparing dqlite with rqlite and Litestream, other replication software for SQLite.

Wire protocol

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

Install

If you are on a Debian-based system, you can get the latest development release from dqlite's dev PPA:

sudo add-apt-repository ppa:dqlite/dev
sudo apt-get update
sudo apt-get install libdqlite-dev

Build

To build libdqlite from source you'll need:

  • A reasonably recent version of libuv (v1.8.0 or beyond).
  • A reasonably recent version of sqlite3-dev
  • A build of the C-raft Raft library.

Your distribution should already provide you with a pre-built libuv shared library and libsqlite3-dev.

To build the raft library:

git clone https://github.com/canonical/raft.git
cd raft
autoreconf -i
./configure
make
sudo make install
cd ..

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

autoreconf -i
./configure
make
sudo make install

Usage Notes

Detailed tracing will be enabled when the environment variable LIBDQLITE_TRACE is set before startup.

dqlite's People

Contributors

freeekanayaka avatar mathieubordere avatar cole-miller avatar stgraber avatar mjeanson avatar rabits avatar paulstuart avatar dependabot[bot] avatar cyphar avatar hamberfim avatar cameronnemo avatar ericcurtin avatar tomponline avatar growdu avatar fitojb avatar muir avatar frankh avatar kunzef avatar nanjj avatar ruakij avatar shade34321 avatar nsg avatar sixcorners avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.