Records are kept sorted by key, and each node owns one contiguous range of keys. Neighbouring keys live together, so a query for a range of keys asks only one or two nodes, and a range that grows too big is split in two. The risk is keys that all arrive at one end, such as rising ids or timestamps: every new write lands in the same range. Below, add nodes to watch ranges split, and turn on range queries and sign-ups to see both sides.
The strip in the panel is the key space, oldest ids on the left; each coloured stretch is one node's range. Each dot in a node is one user record, coloured by country. Add a node and the records of the range that splits glide to the new node, ringed so you can count them. A node turns red when it serves well above its share of requests.
1. Total data
2. Ranges
3. Nodes, filled to 70%
4. Adding one node
5. Sign-up writes
Step 1 is the storage estimate from the back-of-the-envelope chapter of Alex Xu's System Design Interview, Vol. 1. Step 2 uses the split rule CockroachDB documents: a range that reaches the size limit (512 MiB by default) is split into two, so a range holds between about half the limit and the full limit. Step 4 assumes the system moves ranges until every node holds the same share. Step 5 is plain arithmetic: a rising key sends every new write to the end of the key space.
All three keep rows sorted by key, split ranges as they grow, and warn against rising keys.
range_max_bytes, 512 MiB by default, is split in two, and load-based splitting splits busy ranges too. Its hotspot guide notes that with a continually increasing key "all writes appear at the index tail", and that load-based splitting does not resolve such moving hotspots.All are official documentation from Google Cloud, Cockroach Labs and the Apache HBase project. Quoted phrases are short attributed quotations; everything else is described in our words.