Three Roads to Serializability — Serial Execution, 2PL, SSI

Three Roads to Serializability — Serial Execution, 2PL, SSI An architecture diagram generated by Archify. OLTP Workload · short, fast transactions · Architecture component OLTP Workload short, fast transactions Serial Execution · one transaction at a time · All three give full serializability · they differ in cost, scalability, and operational pain · VoltDB · Datomic · Redis Serial Execution one transaction at a time VoltDB · Datomic · Redis Two-Phase Locking · shared and exclusive locks · All three give full serializability · they differ in cost, scalability, and operational pain · MySQL/InnoDB · SQL Server Two-Phase Locking shared and exclusive locks MySQL/InnoDB · SQL Server Serializable Snapshot · optimistic, checked at commit · All three give full serializability · they differ in cost, scalability, and operational pain · PostgreSQL · CockroachDB Serializable Snapshot optimistic, checked at commit PostgreSQL · CockroachDB Single-Core Ceiling · throughput of one CPU core · All three give full serializability · they differ in cost, scalability, and operational pain · shard to scale out Single-Core Ceiling throughput of one CPU core shard to scale out Waits and Deadlocks · latency spikes under load · All three give full serializability · they differ in cost, scalability, and operational pain · big readers block writes Waits and Deadlocks latency spikes under load big readers block writes Aborts Under Contention · optimistic retries grow · All three give full serializability · they differ in cost, scalability, and operational pain · keep read-write tx short Aborts Under Contention optimistic retries grow keep read-write tx short run one at a time lock before access proceed, check at commit cost: one slow tx stalls all cost: waiting and deadlocks cost: retries under contention All three give full serializability · they differ in cost, scalability, and operational pain Legend Database External