Do we have a pure OCaml, high-performance, persistent key-value store in 2023?

Thanks.

As I should have noted in the second set of questions, I am seeking a reason why you would not use RocksDB for your need.

As for an OCaml API for RocksDB found this:

which then caused me to search if @Chet_Murthy referenced it earlier, which I am not finding. :thinking:

Obviously I have not tried it.

Instead of me asking more questions, if/when you know that RocksDB solves/does not solve your problem it would be appreciated if you responded with details to this thread. :slightly_smiling_face:

Speaking of which, I’d really appreciate updates to the database page on ocamlverse. I’m not familiar with the different products and the differences between them.

2 Likes

FYI, I wrote that for my own needs, though I do think that the approach there (of using ad-hoc polymorphism to generate the type-conversions) is very powerful. I was able to use it only on the C++ side, but I think that if OCaml had modular implicits, I could have done some on the ocaml side, too. This is how Rust’s Python adapter generates type-conversion code, too.

In any case, there are two RocksDB adapters in the opam repository:

ahrocksdb    --          A binding to RocksDB
orocksdb     --          ctypes based bindings for rocksdb

as well as a LevelDB adapter

leveldb      --          OCaml bindings for Google's LevelDB library

I originally used orocksdb, but needed more entrypoints from RocksDB; at that point, the complexity of writing the type-conversions “by hand” led me to abandon that and switch to an automatically-generated approach.

3 Likes

I will give a try at the ocaml bindings for rocksdb, because I think ahrefs is using them in production.
This is tracked, so might eventually be done:

1 Like

The Mina project is using RocksDB with a slightly-modified orocksdb:

I think you have a very valid question and desire but IMO there is no simple answer for this (think table of properties), for me to know takes a very detailed and long decision tree that often requires doing some proof of concept when a unknown product is possible (ref). Even then just knowing which questions to ask is often unknown, most often such questions are just gained from experience, reading and communicating with experts.

You might want to have your question and my reply moved to a new topic, I would interested to see other replies even if they disagree with mine.