Lab 02 / Distributed systems

Agreement isn't automatic.

A key finds its owner. A write reaches a replica. A node goes offline. Explore the consequences, one reproducible step at a time.

Interactive cluster simulation

Cluster configuration

Changing a parameter resets the cluster. Each replica after the primary adds its index minus one to the base lag.

Playback writes on ticks 1, 5, 9... and reads on ticks 4, 8, 12... No random events.

0Logical tick
4 / 4Live replicas
0Keys moved on last membership change
64KEYS / CLOCKWISE OWNERSHIPDots = keys and virtual-node positions
node-A11 keys
node-B6 keys
node-C21 keys
node-D26 keys

Event timeline

Cluster initialized. Node A is the fixed primary. Step to write version 1.

  1. t=0Cluster initialized. Node A is the fixed primary. Step to write version 1.

Two models, one control panel.

The hash ring models key placement only. The replication view models a single key replicated to all N nodes. Ring ownership does not control replica placement; combining the displays does not make this a distributed database.

Explicit assumptions

  • Node A is a fixed primary. There is no election, consensus protocol, clock skew, partition healing, or concurrent writer.
  • A write commits only with a live primary and at least W live replicas. The first W live replicas acknowledge immediately; others receive queued snapshots on logical ticks.
  • A quorum read selects the first R live replicas in node order and returns their maximum version. Single-node reads bypass quorum deliberately.
  • Failures preserve memory. Recovery re-enables queued delivery. Same-tick writes coalesce; offline replicas retain the latest snapshot. This is not a real transport or durability guarantee.
  • R + W > N guarantees set intersection for a fixed membership, not linearizability by itself.
  • The hash is deterministic and non-cryptographic. Key movement counts include keys becoming unassigned when every node is down.

Search the notebook

Search articles, projects, and experiments. Everything stays on your device.

palash / notebook

A small doorway into the site. No shell, no remote execution.

Welcome. Type help to find your way around.

lab →experience →contact →Ctrl / Cmd + K