Hacker News new | past | comments | ask | show | jobs | submit login
MVCC Unmasked (2011) [pdf] (momjian.us)
39 points by Tomte 18 days ago | hide | past | web | favorite | 12 comments



It might help to imagine this as an implementation of a persistent data structure.

https://en.wikipedia.org/wiki/Persistent_data_structure

The persistence allows previous states of the data structure to be used in still ongoing, "older" transactions.


datomic is built on this concept ?


pretty much. Datomic is roughly what you get if you do MVCC, but never garbage-collect old entries and support querying at a chosen version/timestamp.


I really need to understand MVCC but this isn't greatly helpful. It starts assuming you understand the basics (which is fine, but be aware) but it's really just a 20% slideshow adjunct to a talk that would fill in the remaining 80%.


The author's "presentations" page includes links to video versions (I haven't checked them out yet): http://momjian.us/main/presentations/internals.html


Good one, thanks!


Postgres like most other databases pretty much copied MVCC from Interbase/Firebird. I found the following explanations for Transactions in Firebird very helpful in terms of understanding MVCC aka MGA (multi-generational architecture)

https://ib-aid.com/en/transactions-in-firebird-acid-isolatio...

https://www.slideshare.net/ibsurgeon/3-how-transactionswork


MVCC was described in detail by David Reed in his 1978 thesis. Everyone "copied" him. Do you have cites for your assertion that Postgresql copied Interbase and not read published CS papers on the topic?

The term "MGA" also seems to be a rebranding private to the Interbase universe so I question that "MVCC aka MGA" bit as well.


I looked that up. From https://en.wikipedia.org/wiki/InterBase

"Although InterBase's implementation is much more similar to the system described by Reed in his MIT dissertation than any other database that existed at the time and Starkey knew Bernstein from his previous position at the Computer Corporation of America and later at DEC, Starkey has stated that he arrived at the idea of multiversion concurrency control independently.[3] In the same comment, Starkey says:

The inspiration for multi-generational concurrency control was a database system done by Prime that supported page level snapshots. The intention of the feature was to give a reader a consistent view of the database without blocking writers. The idea intrigued me as a very useful characteristic of a database system."

Seems you're right.

Curiously, I'd assumed before starting to read about MVCC that history was done at a page level as described above, whereas it seems it's generally done at the row/tuple level


Didn't mean to trod on anyone's toes. I think interbase (from which firebird forked) was the first successful/important database system to use MVCC. I just mentioned MGA because that was how I first and commonly have heard MVCC described. I guess David Reed was the first to come up with the idea even if he never implemented it. But I doubt that Postgres ignored what Interbase had demonstrated as being feasible and successful in practice.


I haven't heard of a link between Firebird and PostgreSQL with regards to MVCC before. I remember using PostgreSQL 6.5 with MVCC on a project back in 1999, but Borland didn't open-source InterBase (as Firebird) until after that project. Are you saying PostgreSQL "pretty much copied" the concept of MVCC, or some specific implementation? I thought MVCC was decades old by 1999.


Interbase might not have open-sourced by 1999 but they were using MVCC from the early 80s.




Applications are open for YC Winter 2020

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: