Index

Module 08 · From ScratchSharded KV store

Build Your Own Dynamo

Partitioning
Partitioning · Open board

One pile of data cut into slices, one slice per machine, and the ways of deciding which slice a name goes to. The warning in its bottom half, never pick the machine by dividing by the machine count, is the first wall this build hits.

Before you start. This series builds a small copy of Dynamo, the store Amazon wrote to keep each saved value on several machines and keep answering while some of those machines are dead. You need two ideas, refreshed here: a hash is a scrambler that turns any name into a big number, the same number every time for the same name, and a replica is one copy of a value kept on another machine, so the value survives when the first machine dies (if Go is new to you, Enough Go to read these builds is an optional read first).

Code: teaching/code/from-scratch/kv/ - one Go module, each stage runs alone: go run ./01-ring … go run ./04-anti-entropy. Nothing listens on a network: the five machines are five entries in one program’s memory, so every run prints the same lines.

Continue reading with a plan

The first three lessons of every track are free. This lesson is included with a plan, which unlocks every lesson, board, video, lab and paper for one price.

View plans →Already a member? Sign in

Related paper

Review From Scratch →

Saved in this browser, and to your account when you sign in.