Proposal

The only pure Rust alternative is redb but it still does not support to be opened by different processes. Hence, we can forget it.

IMO, rocksdb is recommended, it is blazing fast comparing to rusqlite. rocksdb has the column family design, which is quite fit to our project (one column family for DA blobs and the other for blocks). The column family feature just like we can create tables in SQL. RocksDB by using memory map and cache, makes both read and write performance very fast. There are some blockchains already using rocksdb in production, so we may can give it a try? But, rocksdb also ordered by key, we still need to think a way to support range query for our blocks data (indexing or use the block height as the key).

Requirements

Key-value Database

Three kinds of main architecture:

Toughts:

In our case, read performance is more important than write performance, but we also need to try our best to utility disk usage. If we will finally persistent data to a standalone database, then Bitcask is better. If not LSM is better.

(However, Rust does not have bitcask key-value database, and the only LSM based key-value database is rocksdb, a C++ binding crate).

Available options for Rust