Skip to content

Routing requests from 1 node to other - Eliminating use of Load Balancer #7

@rishabhverma17

Description

@rishabhverma17

Instead of a load balancer, implement Redis-style client routing in HyperCache:

Hash Slots: Divide keys into 16,384 slots
MOVED Responses: Tell clients which node has their key
Cluster State: Nodes share who owns what slots
Smart Clients: Clients learn and cache the cluster map
This would eliminate the load balancer entirely and make HyperCache work exactly like Redis cluster - much more efficient!

Redis way (no LB, client-side routing) is the gold standard for distributed caches.

Redis works this way
Redis Cluster Magic:

Client connects to ANY node

redis-cli -c -h redis-node1 -p 7001

If key is on wrong node, Redis responds:

> GET mykey
-> Redirected to slot [8923] located at 192.168.1.3:7003
"myvalue"

Client automatically learns the cluster topology!

Why HyperCache Needs LB (Currently):

Without LB, clients must guess which node has data

redis-cli -h node1 -p 8080  # Maybe has the key?
redis-cli -h node2 -p 8081  # Maybe has the key?
redis-cli -h node3 -p 8082  # Maybe has the key?

No automatic routing = client confusion!

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions