https://github.com/hansonkd/bundledb
Even though this isn't production ready, I decided to publish the first iteration of BundleDB in case it helps anyone. It allows developers to build collections (Sets, Maps, Lists/Queues) on top of traditional Key-Value Stores.
You might find this project useful if you need an embedded DB or want to build a lightweight DBMS.
It was inspired how Redis collections work (but very different)
- Collections remain embedded until a certain size.
- After reaching a limit, the collection will pop out of being embedded into its own shard in the KV store.
- A shard will split into smaller chunks if it gets too large.
Collections can be nested.
Its currently in pre-alpha as I haven't finished the product which will be using this. This initial release is focused on the API and structure. It is somewhat optimized but it hasn't been through the gauntlet of running in production.
The default is using BadgerDB, but can be any KV store.
评论:
mastabadtomm:
I just wonder that how you handle garbage collection with BadgerDB. It seems problematic to me:
- https://github.com/dgraph-io/badger/issues/464
- https://github.com/dgraph-io/badger/issues/444
- https://github.com/dgraph-io/badger/issues/354
I have used LevelDB in one of my personal projects instead of BadgerDB due to GC design.
kyle-hanson:I built the KV access as an abstraction so the backend db can be changed by swapping the db interface instance. Badger is nice when prototyping, since very simple API. But, will probably end up building a plugin for leveldb.
