Why LMDB database taking more than actual data size? Why LMDB database taking more than actual data size? database database

Why LMDB database taking more than actual data size?


The database is bigger than the original file because lmdb requires to do some bookeeping to keep the data sorted. Also, there is an overhead because even if your record (key + value) is say 1kb lmdb allocates a fixed size of space to store those. I don't know the actual value. But this overhead is always expected.

Compression doesn't work well on small records.

lmdb doesn't support prefix or block compression. Your best bet is to use a key-value store that does, like wiredtiger.