Database / Google Spanner Database Interview questions
Explain the execution flow of a read-write transaction in Spanner?
A read-write transaction in Spanner moves through acquisition of locks, buffered writes, and a two-phase commit if the transaction spans more than one split.
Reads within the transaction take shared locks on the rows they touch, and writes take exclusive locks, held until commit or abort. If the transaction only touches one split, the leader for that split can commit directly through its own Paxos group. If it spans multiple splits, one participant is chosen as the transaction coordinator, running two-phase commit: it collects a "prepared" vote from every participant group, then picks a commit timestamp using TrueTime and applies commit wait before releasing locks and returning success to the client. Any lock conflict with a concurrent transaction can cause an abort, which the client library typically retries transparently.
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...
