Database / Google Spanner Database Interview questions
What is the difference between read-write and read-only transactions in Spanner?
| Read-write transaction | Read-only transaction |
| Uses locking and two-phase commit to safely mix reads and writes. | Never takes locks; only reads data. |
| Always reads the latest committed data (strong reads). | Can read at a specific timestamp, including a slightly stale one. |
| Higher latency due to commit coordination across replicas. | Lower latency, and can be served from the nearest read replica. |
Read-write transactions are the only way to write data and are used whenever a read result influences a subsequent write. Read-only transactions are cheaper because they skip locking entirely; using exact staleness or bounded staleness with a read-only transaction lets an application trade a small amount of freshness for significantly lower latency, which matters for read-heavy, latency-sensitive workloads like dashboards or product catalogs.
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...
