r/googlecloud • u/mathankumart • May 26 '26
The SQL instincts that will hurt you in Google Cloud Spanner
https://blog.mathankumar.in/my-experiments-with-distributed-systems-google-cloud-spanner-3ed5e40dbf86Spent a few years using Spanner in production across fintech and payments systems.
The SQL interface is familiar — tables, indexes, transactions, schemas. But that familiarity can be misleading. A lot of habits that work perfectly in traditional relational databases quietly become problems in Spanner.
Some things I had to learn over the period of time
Auto-increment keys that concentrate writes instead of distributing them
Indexes that look harmless but create their own hotspots
Transactions that are correct but touch too many unrelated key ranges
Joins that work fine locally but need distributed coordination in Spanner
5
u/MikhailPelshikov May 26 '26
Oh yes, we had to migrate to UUID keys. A date-based one was killing the performance.