Databases 3 min read

Understanding Undermoon’s Chunk: Building Balanced Redis Clusters in Rust

The article explains how Undermoon’s Chunk, composed of two proxies and four Redis nodes spread across two machines, forms the core building block for a balanced Redis cluster topology and load‑balancing strategy, detailing its node layout, failover behavior, and simple allocation algorithm.

Hacker Afternoon Tea
Hacker Afternoon Tea
Hacker Afternoon Tea
Understanding Undermoon’s Chunk: Building Balanced Redis Clusters in Rust
Chunk

is the basic building block of an Undermoon Redis cluster. It provides a structured topology for workload balancing and consists of 2 proxy processes and 4 Redis nodes evenly distributed across two physical machines.

In a typical deployment the first half of the chunk contains 1 master node and 1 replica; the peer nodes reside in the second half.

If the second half fails, all Redis nodes in the first half are promoted to master role.

Chunk Allocation

Undermoon does not employ a complex scheduling strategy. It uses a simple Redis‑node allocation algorithm to achieve load balancing:

Master nodes should be evenly spread across all machines.

After a failover, the traffic surge from the failed master must be evenly distributed across all machines in the cluster.

The algorithm details and formal proof are documented in the chunk allocation file:

https://github.com/doyoubi/undermoon/blob/master/docs/chunk_allocation.txt

The node allocation algorithm aims to assign node blocks to achieve maximum balance, i.e., to distribute the failover of lost masters as widely as possible across the entire cluster.
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Rustload balancingRedisClusterChunkUndermoon
Hacker Afternoon Tea
Written by

Hacker Afternoon Tea

You might find something interesting here ^_^

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.