Two-Layer Consistent Hashing for Session Affinity

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In cloud computing environments, maintaining session affinity between client devices and server computers is inefficient due to the lack of server identification, which compromises security and leads to loss of cached information during session disconnections and reconnections, especially when requests are routed to any of multiple servers rather than a specific one.

Innovation Solution

A two-layer consistent hashing mechanism is employed to ensure session stickiness without requiring stateful load balancers to store past session information, using deterministic hashing algorithms to select the same load balancer and backend host server for each session, thereby maintaining session affinity and reducing the need for cookie-based approaches that compromise security.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If server identifier is provided in cookie to maintain session affinity, then session stickiness is improved, but security is compromised and server behavior can be mapped by hackers

Engineering Contradiction:
Improvesession affinityVSAvoidsecurity vulnerability
Core Design Contradiction:
ReliabilityVSObject-affected harmful factors

Solution Approach 1:

The patent introduces a load balancer as an intermediary component that performs consistent hashing to determine server routing decisions. The load balancer acts as a mediator between client requests and server selection, using deterministic hash functions to maintain session affinity without exposing server identifiers to clients or allowing direct mapping of server behavior.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Adaptability or versatility

If cloud structure routes requests to any of multiple servers, then system flexibility and scalability are improved, but cached information is lost during session disconnection and reconnection

Engineering Contradiction:
Improverequest routing flexibilityVSAvoidcached information loss
Core Design Contradiction:
Adaptability or versatilityVSLoss of information

Solution Approach 1:

The patent implements preliminary action by pre-establishing deterministic routing rules through consistent hashing before session disconnection occurs. The hash function is pre-configured and remains consistent, ensuring that when a client reconnects, the same server is automatically selected without requiring session state maintenance or risking information loss.

Inventive Principle:
Principle #10Preliminary action

3Reliability

If stateful load balancers store past session information to maintain affinity, then session stickiness is improved, but device complexity and memory requirements increase

Engineering Contradiction:
Improvesession affinityVSAvoidload balancer complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent applies self-service by enabling the client to perform the routing decision locally using deterministic hashing algorithms. Instead of requiring the load balancer to store and remember session information, the client independently calculates the server selection based on pre-shared hash functions, eliminating the need for stateful load balancer operations.

Inventive Principle:
Principle #25Self-service

4Reliability

If cookie-based server identification is used, then session affinity is maintained, but network traffic increases due to repeated cookie transmission

Engineering Contradiction:
Improvesession affinityVSAvoidnetwork traffic volume
Core Design Contradiction:
ReliabilityVSLoss of energy

Solution Approach 1:

The patent extracts the server identification function from the cookie-based approach and replaces it with deterministic hashing. The hash function processes client request parameters to generate server routing decisions without requiring repeated transmission of server identifiers or cookies, thereby reducing network traffic while maintaining session affinity.

Inventive Principle:
Principle #2Taking out (Extraction)

Data Source

PatentUS9838482B1Maintaining client/server session affinity through load balancers
Publication Date: 2017.12.05 AMAZON TECH INC
  • US9838482B1 patent drawing
  • US9838482B1 patent drawing
  • US9838482B1 patent drawing

AI summary

In one embodiment, a system uses a two-layer deterministic function, such as a hashing mechanism, to ensure session stickiness or affinity. A client can generate a session key that can be used for at least two things. First, a load balancer can be selected by the client using the session key by using a consistent or deterministic hashing algorithm so that the same load balancer is selected from a set of weighted load balancers. After selecting the load balancer, the client can send the request to the selected load balancer. The load balancer then uses the same session key, which can be transmitted in an HTTP header, to select a backend host server computer. The result is that session affinity is maintained.