Ayende @ Rahien

Refunds available at head office

Reviewing Lightning memory-mapped database library: MVCC

MVCC stands for Multi Versioning Concurrency Control. This is how you can have both readers & writer at the same time and not have to arrange locks for the two. With LMDB, MVCC is implemented by always creating a new page, never modifying them in place. That also means that when we “free” a page, we need to make sure not to actually use it until all the transactions that could see it has completed.

To be honest, I can’t follow the code. It is somewhat related to me_pghead , but I just can’t follow what is going on. I think that this is related to the way it manage multiple transactions, but I am just unable to follow the code .Maybe it is just that I overloaded my senses with too much C code, I have been diving into this code, and sometimes it feels like this:

That said, I understand how it has to work, so that should be enough for now. Next, I want to see how to do it myself Smile.

Comments

Rafal
08/08/2013 08:01 PM by
Rafal

There's one nice side to your LMDB series - without that I wouldn't even know such library exists, and it certainly deserves better recognition. But I don't like the ending very much. After all, the title is 'Reviewing the LMDB', so where's the review?

Sam
08/08/2013 11:43 PM by
Sam

Lol, this post is obviously more about psychology.

Ayende Rahien
08/09/2013 07:15 AM by
Ayende Rahien

Rafal, What do you think those posts are?

Rafal
08/09/2013 03:05 PM by
Rafal

Well, i'm not sure what they are. You've expressed some opinions about source code not being up to your expectations and general difficulty in understanding it, but today's post looks like a final one and there's no conclusion other than you're going to copy some part of LMDB... I'd expect a comparison to other libraries, pointing out of good and bad sides, an 'overall' verdict (do you like it or not, why?) etc.

Ayende Rahien
08/09/2013 03:41 PM by
Ayende Rahien

Rafal, I went over the codebase in details, offering comparisons for other stuff, and talking about how it works. I have a summary post scheduled for 22th, but that is pretty much it.

Comments have been closed on this topic.