HACKER Q&A
📣 wg0

Serverless” key value store with transactions?


I am looking for a key value store that is: - based on LSM trees (hence sorted keys on disk) - Is serverless (like SQlite) - Also supports transactions

Some that I know are LevelDB, pebble, rocksDB, foundationsDB but each of them either is not "serverless" or doesn't support transactions.

What other options are out there if any? Also, how hard it would be to add transaction support to something like pebble? What particular knowledge would be required?


  👤 minhmeoke Accepted Answer ✓
I just found these today which are LSM-based storage engines which supposedly support both transactions. Sled can operate on a single file, I'm not sure about wiredtiger. I've never used either of these before though, so please perform your own due diligence:

- https://github.com/spacejam/sled

- http://source.wiredtiger.com/11.0.0/overview.html

To add transaction support, you probably need a good understanding of how the memtable works in Log Structured Merge trees: https://creativcoder.dev/what-is-lsm-tree

as well as how to implement something like https://en.wikipedia.org/wiki/Optimistic_concurrency_control

You might also be interested in the design of the Nova database: https://www.usenix.org/conference/fast16/technical-sessions/...

There are probably newer system designs out there, this just happened to be linked from the creativcoder.dev article above.