Company
Date Published
Author
Sid Choudhury
Word count
3459
Language
English
Hacker News points
None

Summary

Google Spanner and Calvin are two approaches to achieving global consistency at scale in distributed databases. While both systems aim to provide strong consistency, they differ significantly in their design and implementation. Google Spanner uses a partitioned consensus approach with TrueTime-based clock skew tracking, which allows it to guarantee correctness of multi-shard/distributed transactions under bounded clock skew scenarios. On the other hand, Calvin uses a global consensus approach that avoids clock skew tracking by preprocessing transactions, resulting in higher write throughput for certain workloads. However, this comes at the cost of lower availability and increased latency for writes. Additionally, Calvin's restrictive transaction model makes it unsuitable for building SQL-compatible databases. Spanner, on the other hand, supports full SQL complexity and has better performance for read-only transactions and general-purpose high-volume concurrent transactions. Overall, the choice between Spanner and Calvin depends on the specific use case and requirements of the application, with Spanner being a better fit for applications requiring strict serializability isolation level and Calvin being more suitable for distributed-transaction-heavy workloads with low conflict access to same data in concurrent transactions.