سؤال

I like the look of LevelDB as a database for my application but there is one issue.

I would like to store data into the database but when I read the data sometimes I only need a particular section of the data. As well as leveldb_get(db, readOptions, key, keySize, &size, &err) I'd like something like leveldb_get_subsection(db, readOptions, key, keySize, offset, size, &err) but that does not exist.

I could, of-course, index the data into smaller sections but I was wondering if there was a good alternative to LevelDB that allows me to read a subsection of a record/value which makes much more sense. Are there any recommendations?

I require atomic operations which are synchronised safely to the disk, as data integrity is important. Also I need a C interface.

Thanks.

هل كانت مفيدة؟

المحلول

The solution was to write my own key-value database code. What I've done so far is here: https://github.com/MatthewLM/cbitcoin/tree/master/dependencies/storage

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top