Currently, we use GoRocksDB which uses C API from Facebook’s RocksDB.
The problem is that when we want some new functionality, e.g., blockcache getusage, the function might not be in RocksDB C API or GoRocksDB. To add it to both can be time-consuming.
Another problem is that GoRocksDB is currently not compatible with the latest version of RocksDB. We have to help maintain GoRocksDB.
Here are some alternatives:
- Fork someone’s C API. Fork someone’s Go wrapper. Maintain both ourselves.
- Fork someone’s Go wrapper but continue to use someone’s C API.
- Do away with C API. Try to swig the C++ directly. This seems tricky and may require some extra C++ code around a small subset of functions to make it more swig-friendly. We have done a bit of exploration here.
I personally prefer either (1) or (3), and maintain everything ourselves end-to-end.
Firstly, there are really not that many RocksDB functions that we need I believe, and we can grow these wrapper code over time.
Secondly, RocksDB core functions seem quite stable and I doubt we need to do much maintenance. The more functions you try to use, the more maintenance you need, but we can reduce our usage.
Thirdly, these wrapper code are not always the fastest. C API does some copying and some Go wrappers (not GosRocksDB) will do an additional copy probably with cgo.GoString(C string). If we maintain our wrappers, we can explore further optimization and potentially gain an edge here.
What do you all think?