Database / Google Spanner Database Interview questions
What happens when a hotspot occurs in Spanner?
A hotspot happens when a disproportionate share of reads or writes lands on a small number of splits, usually because the primary key is monotonically increasing (like a timestamp or auto-increment ID) or because one key value, such as a popular tenant ID, gets far more traffic than others.
When this happens, throughput on that narrow key range gets capped by a single split's capacity, no matter how many nodes the instance has overall; you'll see elevated latency and CPU utilization concentrated on specific splits in Cloud Monitoring, along with lock contention if writes are also hitting the same rows. Spanner can move a hot split to its own server, but it cannot subdivide traffic on a single key value, so the fix is schema-level: hash or shuffle the key, add a random prefix, or use bit-reversed sequential IDs so writes spread across the keyspace.
More Related questions...