What is Spanner's TrueTime and how does it enable external consistency?
Answer
TrueTime is Google's globally synchronized clock API used internally in Cloud Spanner to achieve external consistency (the strongest consistency guarantee — stronger than linearizability). TrueTime exposes the current time as an interval [earliest, latest] with a known error bound (typically under 7ms), based on GPS and atomic clocks in every Google data center. Spanner uses this to implement commit wait: before committing a transaction, the database waits until the commit timestamp is safely in the past (beyond TrueTime's uncertainty). This guarantees that any subsequent read on any replica will see the committed data. External consistency means: if transaction T2 starts after T1 commits (in real-world time), T2 always sees T1's writes — even across continents. This eliminates the need for distributed coordination protocols like 2PC for certain operations and is what enables Spanner's globally-consistent, serializable transactions.
Previous
How does GCP handle egress costs and what is Premium vs Standard network tier?
Next
What are GCP's options for running AI inference at scale?
More Google Cloud Platform (GCP) Questions
View all →- Advanced What is the GCP data analytics reference architecture (Modern Data Stack)?
- Advanced What is GKE Autopilot and how does it differ from Standard mode?
- Advanced How does GCP implement IAM for BigQuery data governance?
- Advanced What is Google Cloud's approach to multi-region high availability?
- Advanced What is VPC Service Controls in GCP?