Part 30 of 39

The Mixed-Up Pebbles

By Madhav Kaushish · Ages 10+

GlagalCloud was busy. Eleven customers, two hundred records per day, fifty queries. The velociraptors were efficient. The protocol was reliable. Then Shepherd Gnelvik received his monthly tax estimate and discovered he apparently owned six hundred and twelve dinosaurs.

Gnelvik owned sheep. Only sheep. He had never owned a dinosaur in his life and had, in fact, a well-known phobia of them — a reasonable phobia, given that his uncle had been sat on by a particularly inattentive diplodocus some years earlier. The six hundred and twelve dinosaurs belonged to Bretchka, a rancher three valleys over, whose data had been stored on the shelf adjacent to Gnelvik's.

The Spill

The investigation revealed a mundane cause. A velociraptor named Thjelvk had been processing Bretchka's quarterly full record — a long one, spanning four trays. The record required twelve baskets of shelf space. Bretchka's designated shelf section had room for ten. Rather than flag the overflow and request a shelf expansion, Thjelvk had placed the remaining two baskets on the next available space — which happened to be the beginning of Gnelvik's shelf section.

When a different velociraptor later ran Gnelvik's tax calculation, it read the data on Gnelvik's shelf, which now included two baskets of Bretchka's dinosaur records at the front. The header system from Part 24 was no help — the stray baskets had valid headers (they were part of a valid record), just not Gnelvik's record. The tax calculation obediently summed everything on the shelf, producing a total that included Bretchka's dinosaurs.

Gnelvik: I do not own six hundred and twelve dinosaurs. I would like this corrected before the tax collector sees it.

Glagalbagal: The tax collector is one of our customers.

Gnelvik: I would like this corrected immediately.

The Isolation Problem

The root cause was simple: nothing in the physical layout of the cave enforced the boundary between one customer's data and another's. Shelves were divided into sections by convention — "Gnelvik's data starts here and ends here" — but there was no physical barrier. A velociraptor could read from or write to any basket on any shelf. The only thing preventing cross-contamination was the velociraptor's knowledge of which section belonged to which customer.

This was, Glagalbagal realised, a terrible design for a shared system. When he was the only customer, it did not matter — all the data was his. With eleven customers, the absence of boundaries meant that every operational error risked mixing one customer's data with another's.

Blortz: Each customer believes they have their own private shelves. In reality, they share a cave with ten strangers, and only a velociraptor's memory separates them.

The Partition Tablets

Glagalbagal's first fix was to make the boundaries explicit and enforceable. He placed partition tablets — heavy stone dividers — between each customer's shelf section. The dividers were physically immovable (Blortz had selected stones too heavy for a velociraptor to shift). Each partition was carved with the customer identifier for the section on each side.

But physical dividers only prevented accidental spillover. They did not prevent a velociraptor from deliberately (or through a procedural error) reading data from the wrong section. The instruction tablets needed enforcement.

Glagalbagal added a customer identifier field to every instruction tablet. When a velociraptor was assigned a task — "process Gnelvik's monthly count" — the task card included Gnelvik's customer code. Before reading or writing any basket, the velociraptor was required to check that the basket's shelf section matched the customer code on the task card. If they did not match: stop, place a red marker stone, report the error.

Stone partition dividers separating shelf sections in the cave, each carved with a different customer symbol. A velociraptor checks a task card against the partition symbol before accessing baskets

The Virtual Cave

The partition system worked for data storage but was clumsy for computation. When a velociraptor ran a calculation, it needed a working area — temporary baskets to hold intermediate results during addition, comparison, or Boolean operations. These working baskets were shared among all tasks. If a velociraptor was interrupted mid-calculation (say, to process an urgent incoming message), the working baskets contained intermediate values from the previous customer's computation, visible to whoever took over.

Glagalbagal extended the isolation principle to the working area. Each customer got a designated set of working baskets, physically separated from other customers' working baskets. When a velociraptor began a task for Customer X, it used only Customer X's working baskets. When it switched to Customer Y, it used Customer Y's.

From each customer's perspective, it was as if they had their own private cave — their own shelves, their own working area, their own velociraptors. In reality, they shared everything. But the partitions, the task cards, and the designated working areas created an illusion of privacy and exclusivity.

Blortz: Each customer sees a private cave. We see one cave with dividers.

Glagalbagal: The illusion only breaks if we fail to maintain the dividers. Which, as Gnelvik's dinosaurs demonstrated, we must never do.

The Access Rule

The final piece was a rule that governed who could access what. Glagalbagal carved what he called the Access Tablet:

Rule 1: A velociraptor may only read or write baskets in the shelf section matching the customer code on its current task card. Rule 2: A velociraptor may only use working baskets designated for the customer on its current task card. Rule 3: No task card may contain more than one customer code. Rule 4: A velociraptor switching between customers must clear all working baskets before beginning the new task.

Rule 4 was Blortz's addition. Without it, a velociraptor finishing a calculation for Bretchka might leave intermediate results in the working baskets — results that the next customer's calculation could accidentally incorporate. Clearing the baskets between customers eliminated this risk at the cost of a few seconds per task switch.

Gnelvik (satisfied, for now): And my data is truly separate from everyone else's?

Glagalbagal: Your data is on your shelves, behind your partition, accessible only through your task cards. No other customer's operations can read it or write to it.

Gnelvik: And the dinosaurs?

Glagalbagal: The dinosaurs are Bretchka's. They always were.

Gnelvik: Good. I do not like dinosaurs.