5 Facts About Jump Consistent Hash: Google’s Tiny Load Balancer

Jump consistent hash explained in plain terms means understanding the sharding algorithm that needs no table, no ring and no memory at all, a few lines of arithmetic that map any key to a bucket. The central question is why a scheme would throw away the ring when the ring is the standard answer to sharding, and the answer is that a ring must be stored and searched, so an algorithm that computes the answer from the key alone is faster, smaller and simpler to run.

Jump consistent hash was published by John Lamping and Eric Veach of Google in 2014, in the paper A Fast, Minimal Memory, Consistent Hash Algorithm. It takes a 64-bit hash of the key and a bucket count, and returns a bucket number by simulating the jumps the key would make as buckets are added, which means the whole algorithm is about five lines, and because it keeps no state, it runs in logarithmic time and constant memory.

This article sets out five facts about jump consistent hash, what it is, how it works, and where it runs in the real world.

Key takeaways

  • Jump consistent hash needs no ring or table.
  • Lamping and Veach published it at Google in 2014.
  • It takes a 64-bit key and a bucket count.
  • It runs in logarithmic time and constant memory.
  • It fits sharded storage, not random caches.

What jump consistent hash is

Jump consistent hash is a consistent hashing algorithm that turns sharding into arithmetic, and that arithmetic is what makes it unusual among hashing designs. The classic ring stores points for every server and searches them, but jump hash stores nothing at all, which means the answer is computed fresh from the key each time, and because there is no structure to keep, there is nothing to rebuild when the cluster grows.

Its signature feature is the jump itself. Imagine growing the cluster one bucket at a time and asking, at each size, whether the key would move to the new bucket, which means the key’s assignment changes only at certain sizes called jump points, and because the algorithm skips straight to the next jump point, it never simulates the sizes in between.

The scheme was a reaction to the memory cost of rings. A ring with virtual nodes needs a sorted table of points for every server, so Lamping and Veach asked whether the same guarantee could come from a formula, because a table that must be stored and searched is a table that costs time and memory, and that practicality is what made jump consistent hash worth building.

It became one of the best-known sharding algorithms in the world, and it is named in every discussion of the field. The paper appeared in 2014, the method was adopted for sharded storage at Google and elsewhere, and it is still the first example engineers meet when they learn that a hash can be computed rather than looked up, which means the scheme survives as a standard even though rings still serve the largest fleets.

Our guide to hashing explains the general hash functions that jump consistent hash builds on, and our guide to CRC32C explains the checksum that takes a different approach to fast hashing.

How jump consistent hash works

Everything starts with the key hash, which seeds the process. The key is hashed to a 64-bit value, which means the algorithm works from a single number, and because the hash is deterministic, the same key always follows the same jumps.

Each step begins with the current bucket, which tracks the answer so far. The algorithm keeps a bucket value and a jump value, starting at minus one and zero, which means the first jump always lands on bucket zero, and because the values only move forward, the answer is the last bucket reached before the count runs out.

The generator is what makes the design work as a whole. A linear congruential generator, seeded by the key hash, produces a pseudo-random number at each step, which means the jumps are deterministic yet evenly spread, and because the multiplier is fixed, every implementation agrees on the same sequence.

The jump formula is what turns the scheme into a fast algorithm. From the random number, the algorithm computes the next bucket count at which the key would move, which means it skips all the sizes where the key stays put, and because the chance of moving shrinks as the cluster grows, the expected number of steps is below the natural log of the bucket count plus one.

The probability is what turns the scheme into a fair distributor. When the cluster grows from n to n plus one buckets, a key moves to the new bucket with probability exactly one over n plus one, which means the load stays even and only the keys the new bucket should own actually move, and because that is the minimum any consistent scheme can move, jump hash meets the ideal.

The result comes from the loop, read out as a bucket number. The algorithm returns the last bucket reached, a number from zero to the bucket count minus one, which means the caller can index straight into its shards, and that verdict is exactly what a storage system needs to make a fast decision.

A dark server room with an engineer checking storage shards on a monitor, a laptop and a notebook on the rack
A dark server room with an engineer checking storage shards on a monitor, a laptop and a notebook on the rack, shows how jump consistent hash works: keys take turns jumping between buckets, step after step, until every shard is filled.

Comparing jump consistent hash with other sharding schemes

Jump consistent hash is one of several ways to share keys across buckets, and each was built with a different emphasis. The Ketama ring is the classic built for memcached clusters, rendezvous hashing is the scoring design built for fair failover, and jump hash is the one built to use no memory at all, while each approach trades something for something else.

The table below sets out the main contrasts between the leading approaches.

Aspect Jump Hash Ketama Ring Rendezvous
Memory None Ring table None
Rebalance Minimal moves Minimal moves Minimal moves
Lookup time Logarithmic Logarithmic Linear in nodes
Keys moved One share One share One share
Best for Numbered shards Cache clusters Fair failover

The practical result is that jump hash is the right choice for numbered shards, the Ketama ring suits cache clusters, and rendezvous hashing fits fair failover instead.

Where jump consistent hash is used

Sharded storage uses it to place data. A storage system that numbers its shards from zero upward maps each key with jump hash, because a shard that only grows at the end fits the algorithm exactly, and that fit is the reason jump hash earns its keep in data stores.

Distributed caches use it for stable placement. A cache that adds servers over time wants keys to stay put, because a key that moves is a key that must be refetched, and that stability is the reason the design was built for growing fleets.

Load balancers use it to assign backends. A balancer that numbers its backends can hash each request to one of them, because a backend that joins takes only its fair share, and that fairness is the reason jump hash appears in routing far beyond its storage origins.

Data pipelines use it to partition work. A pipeline that splits records across workers hashes each record key, because a partition that never reshuffles keeps the work even, and that steadiness shapes how new pipelines are configured.

Teaching uses it as the stateless example. Courses introduce jump hash when they explain that a consistent hash need not store anything, because it is the clearest case of a formula replacing a structure, and a student who understands jump hash understands why memory is a design choice.

Strengths and limits

The greatest strength of jump consistent hash is its lack of memory. An algorithm that needs no table is a rare achievement, and that strength is real, measured in the systems that run it and confirmed by the engineers who keep choosing it.

It is also a strength that the balance is excellent. The paper shows jump hash splits keys more evenly than the classic ring, and that evenness is worth more than cleverness in a field where a hot shard is a failing system.

The limits are real, though, and the biggest is the numbered-bucket rule. Buckets can only be added or removed at the end, which means a server that dies in the middle cannot simply be dropped, and a system that needs random removals must map shards to servers through a small extra table.

Jump consistent hash checklist

  • Use jump hash for numbered shards, never for random servers.
  • Remember Lamping and Veach published it in 2014.
  • Note it needs no ring, no table and no memory.
  • Compare it with the Ketama ring to see formula versus structure.
  • Study the jump, which is what skips the boring sizes.
  • Check the bucket count, since only the end may change.
  • Keep keys hashed to 64 bits, since the loop needs a wide seed.
  • Read the 2014 paper to see how the method was set.
  • Choose jump hash when shards are numbered and memory is scarce.

Frequently asked questions

What is jump consistent hash in simple terms?

It is a sharding algorithm that maps a key to a numbered bucket using a few lines of arithmetic, with no ring or table to store.

Who created jump consistent hash?

John Lamping and Eric Veach at Google, who published it in 2014 in A Fast, Minimal Memory, Consistent Hash Algorithm.

How is jump hash different from the Ketama ring?

Both move few keys when the cluster grows, but jump hash computes the bucket from the key with no stored structure, while Ketama keeps a ring of points to search.

Is jump consistent hash still secure?

It was never meant for security, and its placement is predictable to anyone who knows the key, so it should only be used for sharding.

Where is jump consistent hash used?

In sharded storage, in distributed caches, in load balancers, and in data pipelines that partition work.

When should I use jump consistent hash?

When your buckets are numbered shards, when memory is scarce, or when you study stateless hashing.

The bottom line

Jump consistent hash explained in one line is this: a formula, not a table, a 2014 algorithm that let Google shard with five lines of code and taught the field that the best data structure is sometimes none at all.

It is proof that arithmetic can replace infrastructure, and the reason it still matters is that every stateless hash designed since has been judged partly by the lesson jump hash taught.

This article is general information about how jump consistent hash works, not advice about choosing a sharding scheme for a particular system or workload.

Latest articles

Scroll to Top