[ANN] Khepri 0.1.0 - A tree-like replicated on-disk database library

Jean-Sébastien Pédron jean-sebastien.pedron@REDACTED
Fri Nov 5 10:57:26 CET 2021


On behalf of the RabbitMQ team, I'm proud to announce the Khepri 
database library (https://github.com/rabbitmq/khepri)!

Release 0.1.0 is available on;
     * GitHub (https://github.com/rabbitmq/khepri/releases/tag/v0.1.0)
     * Hex.pm (https://hex.pm/packages/khepri)

Khepri is a tree-like replicated on-disk database library for Erlang and 
Elixir. This is a library we plan to use inside RabbitMQ as a 
replacement for Mnesia. Indeed, we want to leverage Ra[1], our 
implementation of the Raft consensus algorithm, to have a uniform 
behavior, especially w.r.t. network partitions, across all types of data 
managed by RabbitMQ.

In Khepri, data are organized as nodes in a tree. All tree nodes may 
contain data, not only the leaves. Here is a quick example:

     %% Store "150" under /stock/wood/oak.
     khepri:insert([stock, wood, oak], 150),

     %% The tree now looks like:
     %% .
     %% `-- stock
     %%     `-- wood
     %%         `-- oak = 150

     %% Get what is stored under /stock/wood/oak.
     Ret = khepri:get([stock, wood, oak]),
     {ok, #{[stock, wood, oak] := #{data := Units}}} = Ret,

     %% Check /stock/wood/oak exists.
     true = khepri:exists([stock, wood, oak]),

     %% Delete /stock/wood/oak.
     khepri:delete([stock, wood, oak]).

Most of the concepts and a part of the API are described in the 
documentation (https://rabbitmq.github.io/khepri/). Note that the 
documentation is also far from complete.

The implementation is very alpha at this stage. The internal design 
should not change drastically now but the API and ABI might.

I would love Khepri to be as easy to use and intuitive as possible. 
That's why I'm reaching out to the community! If anyone is interested, 
could you please take a look at the documentation and/or the code and 
share your comments?

Thank you very much!

[1] https://github.com/rabbitmq/ra

Jean-Sébastien Pédron

More information about the erlang-questions mailing list