Hash routing uses an explicit integer modulus.

highlighted = computed this step

Hash routing uses explicit modulus

Hash routing in this book is not Python hash. It is the explicit integer remainder key modulo partition count. Note: the remainder is rendered as data.

key mod partition count\text{key mod partition count}

Modulo routes

The compiled modulus is 4, the route count is 4, and the sample remainder is 3.

modulus=4,sample remainder=3\text{modulus}=4,\quad \text{sample remainder}=3

Range and hash sharding are exact routing functions on tiny pinned key sets; real sharding adds consistent hashing, skew, hot partitions, and rebalancing cost, which are empirical and operational concerns beyond this model - no product claims.

Hash routing - hash:mod 4keypartitiontrace3P33 mod 4 = 34P04 mod 4 = 07P37 mod 4 = 38P08 mod 4 = 0

Summary

Hash routing here is exact arithmetic over pinned integer keys. Note: consistent hashing and skew handling are outside this model.

explicit modulus only\text{explicit modulus only}