Hi!
On behalf of the RabbitMQ team, I’m proud to announce the Khepri database library!
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, our implementation of the Raft consensus algorithm, to have a uniform behavior, especially w.r.t. network partitions, accross all types of data managed by RabbitMQ.
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. 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 to have a library which is 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!