Consistent Hash Operation Principle

Consistent Hash Operation Principle An architecture diagram generated by Archify. User A · Cookie: abc123 · Requests User A Cookie: abc123 User A · Cookie: abc123 · Requests User A Cookie: abc123 User B · Cookie: def456 · Requests User B Cookie: def456 Hash abc123 · -> 0x1A2B · Hash Calculation Hash abc123 -> 0x1A2B Hash abc123 · -> 0x1A2B · Hash Calculation Hash abc123 -> 0x1A2B Hash def456 · -> 0x7C8D · Hash Calculation Hash def456 -> 0x7C8D Pod 1 · 0x0000-0x4FFF · Consistent Hash Ring Pod 1 0x0000-0x4FFF Pod 2 · 0x5000-0x9FFF · Consistent Hash Ring Pod 2 0x5000-0x9FFF Pod 3 · 0xA000-0xFFFF · Consistent Hash Ring Pod 3 0xA000-0xFFFF 1 2 Requests Hash Calculation Consistent Hash Ring Legend Backend Security External

Why sessions persist

  • • A specific attribute is hashed so requests always route to the same endpoint
  • • The same cookie abc123 maps to 0x1A2B -> Pod 1 both times
  • • A different cookie def456 maps to 0x7C8D -> Pod 2

Hash keys (consistentHash)

  • • httpHeaderName: HTTP header value
  • • httpCookie: cookie value (auto-generated if missing)
  • • useSourceIp: client source IP
  • • httpQueryParameterName: query parameter value