Also what about concurrent writes? Does it have a database wide writer lock or is it per key (per page?) ?
Also what about concurrent writes? Does it have a database wide writer lock or is it per key (per page?) ?
It is a single-writer DB, one DB-wide writer lock. Fine-grained locking is a tar pit.
Most impressive about LMDB to me is the zero-copy model for readers, with is no extra memcpy needed, maybe that is something obvious for database gurus but it is pretty clever trick I think.
We (Tokutek) tried for a long time to get by with a big monolithic lock, and a) competing with InnoDB was really hard since they do concurrent writers really really well, and b) when we did decide to break up the lock, it wasn't as hard as we thought it would be and it worked really really well.
Don't get discouraged, break up that lock!
As always, you have to profile your workload and see where the delays and bottlenecks really are. Taking a single mutex instead of continuously locking/unlocking all over the place was a win for us.
I can see how the extra code locking/concurrency code would expand the library size out of the CPU cache, though.