Spanner

Notes Two strategies for implementing deadlock prevention used in 2-phase locking Wound wait - Force the lock to release from another transaction Wait die - Wait for lock to be released or die https://stackoverflow.com/questions/32794142/what-is-the-difference-between-wait-die-and-wound-wait-deadlock-prevention-a Distributed Transactions Two problems with distributed transactions Write ahead logging needs to happen on each shard There needs to be a flag on each shard indicating that its in the commit phase (because otherwise locks would be wounded) This is solved using 2-phase commit...

Serializability

Important Reading to help understand: https://jepsen.io/consistency Notes A - Atomicity (All or nothing of a transaction) C - Consistency (Consistent with the constraints on database tables) I - Isolation D - Durability (Handling reboots/failures) Isolation 3 types of dependencies that can help determine serializability - Write - Write Dependency Write - Read Dependency Read - Write Dependency (Anti dependency) Anti Dependency: An anti-dependency, also known as write-after-read (WAR), occurs when an instruction requires a value that is later updated....

Fork-join Consistency

Notes Causal consistency and logical timestamps Logical Timestamps(Lamport timestamps) don’t imply causal consistency 13) Causal Consistency, COPS#Causal

Causal Consistency

Notes Requirements for consistencies Linearizability Global ordering Completion to Invocation globally Sequential Global ordering Completion to Invocation per client Causal Completion to invocation per client Write and then later read dependency Transitivity for 1) #Causal and 2) #Causal Fork-join Causal Eventual

Eventual Consistency

Notes Dynamo is similar to a Distributed Hash Table meaning it uses consistent hashing. Dynamo is called a zero-hop DHT because each node has enough information about the whole consistent hashing ring that it can directly transfer any client to the server responsible for serving that key. Causes for the system not being linearizable Initializing replication factor but not having the same number of writes/reads Membership changes Discovery of membership changes is at different times, due to gossip protocol, causing writes to happen at different servers than intended....