Database / Google Spanner Database Interview questions
Why does Spanner use TrueTime for consistency?
Spanner needs to order transactions correctly across machines that may be thousands of miles apart, and clocks on separate servers naturally drift, so a plain local timestamp can't be trusted to reflect real-world order. TrueTime solves this by exposing clock uncertainty explicitly, as an interval, instead of pretending clocks are perfectly synchronized.
When a transaction commits, Spanner picks a timestamp and then waits until it is certain that timestamp has passed everywhere, the "commit wait" period equal to the uncertainty bound. This guarantees that if transaction B starts after transaction A commits, B's timestamp will be greater than A's, which is the definition of external consistency. Without TrueTime, Spanner would need a slower consensus round trip on every single commit just to establish ordering, which is why TrueTime is central to keeping global transactions both correct and fast.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
