kriszyp / lmdb-js

Simple, efficient, ultra-fast, scalable data store wrapper for LMDB
Other
505 stars 42 forks source link

Expose MDB_APPEND #43

Closed vladar closed 3 years ago

vladar commented 3 years ago

I am curious about your thoughts on MDB_APPEND flag? It should be useful when storing sequential data in LMDB. It is even listed in Wikipedia page about LMDB as one of the main advantages 🙂

As far as I understand there is no way to use it with lmdb-store. Is it an intentional decision or just not implemented yet?

kriszyp commented 3 years ago

This simply has not been implemented yet, but I think adding support for this seems like a worthwhile addition. I'll take a look at getting this in.

kriszyp commented 3 years ago

Currently there is support for this in putSync, and I have update the docs and types to indicate how to use this. Adding support for async put will be a little more involved. Also, a caveat that these flags are currently implemented through properties in an options objects and a standard put (without MDB_APPEND) is so fast, that it is possible that checking the properties of an object may add enough extra overhead that using append might not be faster.

vladar commented 3 years ago

Thanks!

kriszyp commented 3 years ago

FWIW, I do still plan on implementing a faster version of this.