GOMS. 2026 · Term 1

Mini 3: Micro-Redis Cluster

In Mini 2, you built a Redis. Now you'll make it scale out. Your task is to turn Micro-Redis into a cluster: keys are spread across several storage nodes using consistent hashing, clients keep talking to it with plain redis-cli, and nodes can join or leave while traffic is flowing. As before, you'll write it in Rust, on top of tokio.

The interesting part isn't the hash ring. (That's an afternoon, maybe less with an AI assistant.) It's moving keys from one node to another without losing a write or stopping the world while you do it.

Core Design Requirements

Hash function. So that everyone's experiments are comparable, a key's position on the ring is the 64-bit xxh3 hash of its raw bytes, with seed 0 (the xxhash-rust crate has it). How you place virtual nodes on the ring is up to you.

Moving keys. There are several reasonable ways to migrate a range of keys. You could freeze just that range, copy it, and flip ownership. You could copy it while it's live and then catch up on the writes that happened during the copy. Or you could move keys one at a time and redirect requests for keys that have already left, as Redis Cluster does with ASK. There are others. Choose whichever you can argue is correct, and argue it in your README.

Starting point. You're encouraged to build on your own Mini 2. There's also a reference Micro-Redis in micro-redis, part of our tools repository. It already supports this mini's commands and includes a small client for when one of your processes needs to talk to another. Use it as a fallback if your Mini 2 isn't in good shape, or borrow whatever bits of it you like.

API Specifications

Clients talk to a router using RESP2, exactly as they talked to Micro-Redis. Use the official Redis command reference for each command's behavior. Routers support the following commands:

How routers, nodes and the coordinator talk to each other is your call. Extra RESP commands on the storage nodes are one natural choice; an RPC library such as tarpc is another.

The CLI. The operator controls the cluster with a program called cluster-ctl, which talks to the coordinator. It needs at least these subcommands:

The Checker

We'll ship a checker, mrc-check, that tests your cluster as a black box. It runs many concurrent clients against your routers, mixing SET/GET on some keys with RPUSH/LRANGE on others, and records every request and response. While the workload runs, it adds and removes storage nodes by running cluster-ctl, and it may pause one of your routers (with SIGSTOP) and resume it later. Afterward, it checks the history for lost writes and lists that don't add up.

You'll find it in mrc-check, in the same tools repository. A typical run looks like this:

mrc-check run \
  --router 127.0.0.1:6379 --router 127.0.0.1:6380 \
  --node 127.0.0.1:7001 --node 127.0.0.1:7002 --node 127.0.0.1:7003 \
  --start-node './scripts/start-node.sh' \
  --ctl './target/release/cluster-ctl --coordinator 127.0.0.1:7000' \
  --router-pid @run/router-6380.pid

Here's what it expects from you:

By default, the checker pauses that router, adds a node while it's paused, resumes it, and later removes a node. --schedule changes that, and --schedule "" turns membership changes off, for when you run cluster-ctl yourself. On a correct cluster, clients never see an error or a timeout, so the checker counts those as failures too. When a run fails, it shows the requests that prove it and saves the full history, so you can dig in later with mrc-check check <file>. If you're curious whether your cluster is also linearizable, --strict adds checks for stale reads. Its --help and README cover the rest.

Passing the checker doesn't prove your cluster is correct, but failing it proves it isn't. We'll run it on demo day.

You should still write your own tests. The checker tells you that something went wrong; your tests should help you find out why.

Experiments

Run a few small experiments and report the results in your README (a half page plus a plot or two is plenty):

Exclusionary

You don't need replication, persistence, or recovery from crashes. You don't need BLPOP/BRPOP (they're gone from this mini entirely), multiple databases, or pipelining. The coordinator can be a single process that isn't fault-tolerant, and you don't need to handle two membership changes running at the same time.

Using AI

You're welcome, even encouraged, to use AI assistants for this mini. A lot of it, such as RESP plumbing, the CLI, load generators and plotting scripts, is exactly the kind of code they're good at. The migration protocol is where they tend to be confidently wrong, so that part you'll need to understand and own yourself. Your README should include a short section, Where AI got it wrong, describing at least one concrete bug or flawed design suggestion an assistant gave you and how you caught it.

Suggested Pace

There's nothing to hand in along the way, but here's a pace that should get you to the finish line with time to spare:

How to hand in

Getting Started & Hand-in Instructions

This mini is individual. You'll work in your own GitHub repository.

Demo day. You'll demo your cluster live. We'll run mrc-check against it while you add and remove nodes on our cue. Find another person to help you on the day. Once you've demoed, make the repository public so we can grade it.

Tips and Pointers: