It was holiday time at the North Pole, and letters from little boys and little girls all over the world flooded in as they always do. But this year there was a problem: the world had grown, and the elves just could not keep up with the scale of requests. Luckily, their friends at the Elephant & Chimpanzee Data Shipment Company were available to simplify the process.
To meet the wishes of children from every corner of the earth, each elf specializes in a certain kind of toy, from Autobot to Pony to Yo-Yo.
As bags of mail arrived from every town and city, they were hung from the branches of the Bag Tree. Each time an elf was ready for the next letter, a big claw arm swung out to the right spot on the Bag Tree to retrieve it. "The locality of access is all wrong!" bellowed the chimps. "The next request for Legos is as likely to be from Cucamonga as from Novosibirsk, and letters can’t be pulled from the tree any faster than the crane arm can move!" //// Tie the bags to the real world here, "This is similar to the business issue of …" Amy////
What’s worse, the size of Santa’s operation meant that the workbenches were very far from where letters came in, and from the warehouses that held completed toys. The hallways were clogged with frazzled elves running back and forth between the Bag Tree, their workbench, and the shipping center — they spent almost as much effort on the mechanics of retrieving letters and dropping off gifts as they did making toys. "Throughput, not Latency!" trumpeted the elephants. "For hauling heavy loads, you need a stately elephant parade, not a swarm of frazzled elves!" //// I’d finish this paragraph with a tie-in to the real-world, whatever is equal to letters and heavy loads in the real world, "Again, just as a scientist would…" Amy////
In marched the chimps and elephants, who (singing a rather bawdy version of the Map-Reduce Haiku) built the following system.
As you might guess from the last chapter, they set up a finite number of chimpanzees at a finite number of typewriters, each with an elephant desk-mate. Rather than the centralized Bag Tree, the elephants mustered to distribute mailbags all across the processing stations — now they could be processed locally, rather than clogging up the hallways as the old Bag Tree required.
The chimps' job was to take letters one-by-one from a mailbag, and fill out a toyform for each requested toy. A toyform has a prominent label showing the type of toy, and a body with all the information you’d expect: Name, Goodness, Location, and so forth. Here are some simplified examples: //// Provide eaders with more explanation as to how you arrived at the following classifications below. Amy////
-------------------------------------- # Joe is clearly a good kid, and thoughtful for his sister. He will get a robot and his sister will get a doll.
Deer SANTA robot | type="optimus prime" recipient="Joe" doll | type="green hair" recipient="Joe's sister Julia" I wood like an optimus prime robot and a doll for my sister julia
I have been good this year
love joe
-------------------------------------- # Frank is a jerk. He will get coal.
HEY SANTA I WANT A PONY AND NOT ANY coal | type="anthracite" recipient="Frank" reason="doesn't like to read" DUMB BOOKS THIS YEAR
FRANK
--------------------------------------- # Spam, no action
Greetings to you Mr Claus, I came to know of you in my search for a reliable and reputable person to handle a very confidential business transaction, which involves the transfer of a huge sum of money...
---------------------------------------
//// This is a good spot to insert a business or real world example to tie together the lesson, before moving on to the Toyform stuff. Amy////
So far, this looks a lot like the process for the translation project, with letters in, toyforms out, and the elephant librarians ensuring a steady supply of mail. But a simple transform isn’t enough. //// Please explain why, something like, "…if we attempted a simple transform, what we’d get is…." Amy//// Since the set-up for tying ribbons on Ponies is very different from the set-up for assembling a Yo-Yo, the elves would like to process each type of toy as a group.
So in the new system, each type of toy is handled at the specific workbench designated for that toy. For example, all the robots and hats might go to workbench A, while all the ponies and yo-yos go to workbench B, and all the coal orders to workbench C.
//// Add something here to tie the concept to the real world, like, "…so, again, if this were a biology setting, the correlation would be something like, workbench = Lab A in a biology research lab…" Amy////
Next to each chimpanzee stands a line of pygmy elephants, one for each workbench. Each pygmy elephant bears a vertical file like you find on a very organized person’s desk:
//// Perhaps a smaller sizing for the image? Amy////
The chimps places their toyforms into these file folders as fast as their dexterous fingers can file. Once all the letters in a mailbag have been handled, the elephants march off to the workbench they serve, and behind them a new line of elephants trundle into place, as the chimpanzee tears into a new mailbag. What fun! //// I’m not truly clear what kind of business analogy should be coming to mind for readers here? This is cute, but you might lose readers attention here - consider a business analogy. Amy////
Each pygmy elephant carries its work orders to the workstation it serves. A workstation might handle several types of toys in a factory run, but always in a continuous batch — the elves that handle ponies and yo-yos will see all the ponies first, and then all the yo-yos:
Doll Julia Anchorage AK, USA Doll Royal Dallas TX, USA Doll Wei Ju Shenzen China ... Yo-Yo Jim Mountain View CA
You should wonder how, from all the medley outputs of all the rambunctious chimpanzees, these organized groups are formed. The answer is very clever: the elephants accomplish grouping the toyforms by sorting the toyforms.
Note
|
You can try this for yourself: take a deck of cards, sort them by number, and fan the cards out in a line. You’ll see that trivially separating piles where one number meets the next groups the cards by number. |
/// Provide a practical appliation to a business problem here, to round-out the above section and, again, help readers tie it all together. It doesn’t have to be business per se, but could be archaeology, biology, education, etc. OK? Amy////
Earlier, as I mentioned that the chimps place the toyforms into the file folders, I skipped past an important detail.
The chimpanzees actually file their toyforms into the holder in sorted order. Since the folders aren’t very big, and are immediately adjacent to the chimp’s dexterous fingers, this doesn’t take much additional time.
So when a pygmy elephant delivers its toyform sorter to a workbench, the forms within it are in order — but of course there is no order across all the file folders. Elephant A might have "apple-cheeked", "cabbage patch" and "yellow-haired" dolls, elephant B "malibu", "raggedy", and "yellow-haired", and elephant C only a tall stack of "real Armenian" dolls. That’s no problem though. Each elephant holds its topmost workform at the ready, and passes it to the elves once it’s the next one in order to be processed. So in this case, workforms would come from elephant A, then A again, then B, and so on.
Elves do not have the prodigious memory that elephants do, but they can easily keep track of the next few dozen work orders each elephant holds. That way there is very little time spent seeking out the next work order. Elves assemble toys as fast as their hammers can fly, and the toys come out in the order Santa needs to make little children happy.