liveBook · Manning

Hash value

As explained in Akka in Action, Second Edition

A hash code is a deterministic numeric value computed from input data for use in partitioning or lookup.

A hash value is a deterministic numeric result computed from a message key. In consistent hashing, Akka uses it to select a virtual node and then the routee responsible for that node. section 6.3.4

Consistent-hashing routing proceeds by:

  • Mapping each message to a stable key, such as its message ID. section 6.3.4
  • Computing a hash value from that key. section 6.3.4
  • Using the result to choose a virtual node and its routee. section 6.3.4

Stable message routing

If two Aggregator messages have the same ID, the mapping function produces the same key and hash value, so both messages are assigned to the same routee. Virtual nodes also support more even distribution and route changes. section 6.3.4

Figure 6.7 Steps the consistent hashing router follows to decide which routee to select
CH06_F07_Abraham2

Follow the routing steps from message key through hash value, virtual node, and selected routee. section 6.3.4

How Akka in Action, Second Edition covers it

How deep it goes
Explains key extraction, hashing, virtual-node selection, and routee selection while noting these internals remain hidden from normal users.
Examples
Uses message IDs, Aggregator messages, data enrichment, and data obfuscation to illustrate stable routing.
What it assumes
Assumes a stable message-key mapping and a set of routees participating in a router.
What you can do after
Apply it via Akka consistent-hashing routers to keep equal-key messages on one routee.
How it connects
Connects message keys, consistent hashing, virtual nodes, routees, and group routers.

Also explained in

Compare how 7 books explain hash value →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Akka in Action, Second Edition. The section links point to the parts of the book it draws on.