Closed russhwolf closed 2 years ago
I'm not a Linux expert, but have some experience developing for Linux and would love to see multiplatform-settings support it (use case is a KMP library that will be used from Python). Throwing 2 cents in here, in case it helps.
QDBM is a solid option. For proper transactions and crash recovery, it should be set up using a B+ tree instead of a hash table. I think that requires using the Villa
API instead of this one (ref). It's generally available, but not in Alpine. The author has mostly abandoned this project in favor of Tokyo/Kyoto Cabinet.
A similar option I'd recommend looking into is GDBM, i.e., GNU dbm. It's a rewrite of NDBM, but has features around crash tolerance and crash recovery. It's also widely available, including in Alpine. My guess is that the code would remain largely the same, except checking for the GDBM_NEED_RECOVERY
error code and invoking gdbm_recover()
accordingly.
Other options might seem interesting, but they either haven't been around for as long as Q/GDBM has, they aren't as widely available, have various documented corruption issues, or I haven't heard about them. 😅
I looked at GDBM as well when I first did this, but had licensing concerns. QDBM is LGPL which I understand is safe to link against from Apache-licensed code. GDBM is GPL3 which I understand is not.
Closing in favor of #111 and/or #112
Still needs some cleanup but it should be passing tests now
I remain woefully uncertain whether this is useful from an interop perspective.