4 ms·
This is interesting..I would like to learn more how they implemented MVCC. I wrote single machine MVCC in Java and I'm curious if there are other ways of imple
by samsquire 4y ago
This is interesting..I would like to learn more how they implemented MVCC.
I wrote single machine MVCC in Java and I'm curious if there are other ways of implementing it. One way is event sourcing.
I use an integer to store the latest commit version and I only allow transactions to see versions less than the transaction's timestamp. This is the multiversion part.
The concurrency control part is enforced by checking if the read timestamp of the key is less than the reading transaction timestamp, if so someone got there before us and we abort and restart.
I am thinking how to build the distributed part.
I need a timestamp server the same way Google's Spanner needs TrueTime for monotonic timestamps but also some way of broadcasting read timestamps to detect conflicts between nodes. So I'm thinking of broadcasting timestamp events and using that to detect transactions that have dangerous dependencies.
- losfair 4y agoFoundationDB handles the hard part! It provides monotonic "versionstamps", externally consistent transactions, along with other useful features. I recommend FDB's architecture docs: https://apple.github.io/foundationdb/architecture.html https://apple.github.io/foundationdb/architecture.html
- hrgiger 4y agoThere are plenty of leader election/replication libraries, shouldnt be problem if you pick one and give a shot if you are not confident about your self implementation or just benchmark and see how it goes.