Smite, smote, smitten;
We got magic mittens.
~ Akram Ahmad (a lesser-known poet)
He had mittens, Minjekahwun,
Magic mittens made of deer-skin;
When upon his hands he wore them,
He could smite the rocks asunder,
He could grind them into powder.
~ Henry Wadsworth Longfellow (a slightly more-well-known poet)
Ah yes, this was bound to happen… What with lit getting itself a tech makeover—and an extreme one at that—the last time around, there was no way that tech was going to be left behind. Oh no! Nobody outdoes programmers. Nobody.
So yes, in some sense, all this was inevitable.
So here we are, about to embark on the journey of a lifetime—prepping ourselves to soak in the wisdom of a generation—as we begin to lower ourselves into the gently lapping waves of the ocean whose innocent surface belies leagues of mystery and intrigue shrouding the hitherto unrevealed details of how tech got lit’s mitten. Wait. I surely meant to say, “how tech got lit-smitten.” Yeah, that sounds better.
We’re all ready, I say, for our deep-sea descent. Oh yes, we are ready for a splash!
The Incandescent Descent 🐙
At this time, I urge you to take a few deep breaths and ingest only in small pieces everything that follows, lest you get the bends. Here we go, lowering ourselves into the sea of mystery and intrigue which have, to this day, enveloped the commingling of tech with lit.
We start divulging the juicy details (starting with Shakespeare doing eventual consistency) at 20,000 leagues under the sea, and don’t stop until we reach the depths—descending all the way to the near-unfathomable depths of the Mariana Trenches—and get the scoop on a Silicon Valley tale as told to me by the Brothers Grimm themselves:
Shakespeare Does Eventual Consistency 🎬
Sherlock Holmes On Debugging 🍩
JK Rowling Casts DevOps Spells 🐢
Charles Dickens Is Beguiled By Clock Synch 🎥
Thoreau Does Refactoring, Thoroughly 🚂
The Brothers Grimm Tell A Silicon Valley Tale 🎭
You tracking me so far?
1. Shakespeare Does Eventual Consistency 🎬
To be eventually consistent, or not, that is the question:
Whether ’tis nobler to suffer transactional inconsistencies,
Or to let go the comfortable numbness of transactional guarantees
The slings and arrows of outrageously expensive warranties,
Or to take arms against a sea of ACID troubles
And by opposing end them. To converge—eventually,
No more sloppy quorums; and by a hinted handoff to say we end
The heart-ache and the natural shocks of lossy write availability;
That flesh is heir to replicas: ’tis a consummation of shards
Devoutly to be wish’d. Count monotonic reads—and sheep—to sleep;
To sleep, perchance to dream—ay, there’s the rub:
For in that monotonic sleep, what dreams may come, of sharding
When we have shuffled off this mortal, multi-leader replication,
Must give us pause for garbage collection—there’s the respect
That makes calamity of so long life;
Stop the world, O grim reaper in garbage collector’s garb,
For who would bear the whips and scorns of replication lag,
The oppressor’s wrong, the proud man’s cross-datacenter link,
The pangs of handling write conflicts, the law’s delay,
The insolence of the unmoored Schrödinger’s Cat, and the spurns
That patient merit of a clawing, hot standby, loudly crashing,
When he himself might his inconsistent queries make
With a bare bodkin? Who would bear the requested API version,
To grunt and sweat under a weary two-phase commit,
But that the dread of something after a Byzantine fault,
The undiscovered, unacknowledged messages, from whose bourn
No traveler returns, puzzling the system administrator,
And makes us bear the subsequently redelivered messages
Then fly to other data centers that we know not of?
Thus conscience does make cowards of us all,
And thus the native hue of last-write-wins conflict resolution
Is sicklied o’er with the pale cast of linearizable concerns,
And enterprises of great pitch, especially thine data-warehouse vendors
With this regard their service integration attempts turn awry
And loose the RESTful aspects of action.
Verily, then, eventual consistency can be a good thing—
You see, nothing is good or bad, but the thinking makes it so.
2. Sherlock Holmes On Debugging 🍩
We chance upon two of our friends—the famed detective and his sidekick—sitting on either side of the fireside at the sleuth’s Baker Street lodgings, evidently engaged in deep conversation:
— Sherlock: My dear Watson, the time has arrived to tell you all about the finer points of debugging computer programs.
— Watson: Wussup, Holmes?
— Sherlock: Yo, should you wish to debug—and unsnarl—the snarliest of your programming bugs, mark my words, and follow the advice I’m about to share.
— Watson: Bro, but first tell me it ain’t so?
— Sherlock: What?!
— Watson: Like, shouldn’t we, first of all, divulge to the gentle reader that this is how we actually spoke back in London town, amirite? That is, before Sir Arthur Conan Doyle tiptoed in and started dressing up our language in fancy clothes…
— Sherlock: Sigh, let’s take it one day at a time; today, we do debugging, and only that.
— Watson: Bro, I’m with you on this one. And, of course, with everything else that you say; I’m your sidekick, after all.
— Sherlock: Listen up, Watson, for these are grave matters, whose untoward neglect has led many a man astray.
— Watson: Gosh, I’m all ears. Plus this should teach me a lesson to come around to your your Baker Street lodgings perhaps less often, though I find myself irresistibly drawn to doing exactly that!
— Sherlock: My dear fellow, a certain discretion would befit you more.
— Watson: Don’t you pay any attention to what I just said. Do carry on.
— Sherlock: So here’s the deal: Once you eliminate the impossible, whatever remains, no matter how improbable—such as buffer overflows, SQL injections, improper validation of an array index, and even those pesky null pointer dereferences—must be the truth.
— Watson: You don’t say, bro?
— Sherlock: I do. And there’s more.
— Watson: Gulp. Tell me, boss.
— Sherlock: My dear fellow, life is infinitely stranger than anything which the mind of man could invent.
— Watson: Well, the Chicago Cubs are predicted to win the World Series, you know…
— Sherlock: Hush, boy. Get your mind out of the rut of sports. I’m about to impart forbidden knowledge; it is for your ears only. Come closer and listen carefully.
— Watson: Okay, boss. But but next time please use that mouthwash.
— Sherlock: Listen up. We tread on dangerous ground, with software development costs overrunning corporate budgets out the wazoo, breaking the backs of corporations—all because of a disheartening lack of training in the art of debugging computer programs.
— Watson: You mean it’s no longer halal and kosher to ship software products once the software project compiles?
— Sherlock: No, my boy, no.
— Watson: Great. Now you tell me, with my team and I having just emerged from pulling all-nighters these past two weeks and shipping a major upgrade to London’s stock trading software!
— Sherlock: Buddy, you work your own method, and I shall work mine.
— Watson: Pray continue, dear Holmes; that was a minor detail, anyway.
— Sherlock: You will, at all times, remain cognizant of the dictum that debugging is more—dude, way more!—than “making the bug go away“.
— Watson: Darn. Now he tells me…
— Sherlock: Hush, boy, don’t be so impudent. You must groove with the empirical approach: using the software itself to alert you to what’s going on. Plus, hang on tight to the rigor of the debugging process (reproduce, diagnose, fix, reflect).
— Watson: Sounds halal and kosher to me.
— Sherlock: We don’t have much time on our hands, so let’s get cracking on the steps of the debugging process, starting with reproducing…
— Watson: Whoah, Holmes, you surprise me at times; am I, like, about to get a good old refresher on the birds and the bees?
— Sherlock: No, my dear fellow, I speak not of procreation; it is in the sense of reproducing bugs that I seek to enlighten you.
— Watson: I’m tracking you now, boss. Pray continue.
— Sherlock: Elementary, my dear Watson. Just as most everything nowadays is on-demand—on-demand movies, on-demand water heaters, on-demand interviews to name just a handful—what you’ve got to do is apply the same idea to debugging and find a way to reliably and conveniently reproduce the problem (on-demand!)
— Watson: Um, does this tie in to the supply-and-demand curve perchance?
— Sherlock: Hush, Watson, you digress (Leave that sort of thing to the author of this essay).
— Watson: Say, boss, can we pick up the rest of the debugging process—diagnose, fix, reflect, and stuff like that—some other time?
— Sherlock: Sigh, I surmise that you just might be a ten o’ clock scholar, Watson.
— Watson: Say what?
— Sherlock: Watson, must you be so ignorant in matters of nursery rhymes?
— Watson: Boss, the matter is urgent…
— Sherlock: Oh, why didn’t you say so, then?
— Watson: Ah, perhaps I should have: My iPhone pizza-tracker app was telling me that our delivery of anchovies-laced, personal pan pizza is well on its way to 221-B Baker Street, yay!
— Sherlock: Woohoo! Forget all about debugging.
— Watson: Say what, bro? Oh, and I was getting ready to ask you about the pizza crust—was it supposed to be pan, thin, or thick?—plus impress you with my emerging ideas based on my tangential research into the thickness of the Procrustean Bed.
— Sherlock: On with the real stuff of life, the one around which we must gather: Let’s make hay while the sun shines, dear fellow. And remember to tip the delivery boy because he’s real chummy with my prim landlady, the one-and-only Mrs. Hudson; otherwise, she will be on my case. Again.
With that, our two friends—the famed detective and his sidekick—head straight in the direction of the best that life has to offer: pizza slices dripping with cholesterol.
3. JK Rowling Casts DevOps Spells 🐢
Today, I’m here to tell you the story of the versatile spells—all in the fine tradition of JK Rowling’s’s Harry Potter series—spells whose incantation can summon help when we need it most, which is more often than not especially when dealing with Dev Ops glitches.
Here, then (and by popular demand, in the “Problem-Solution” format of “Glitch—Magic Spell”) is a fine selection of such versatile spells as will make your head spin when you see the ease with which we accomplish our mission and extricate ourselves out of vexing scenarios.
Glitch: A database with fine-grained permission models to control access (e.g. PostgreSQL) is being recalcitrant and locking up unpredictably. How to unlock it? 🔐
Magic Spell: Yell Alohomora loudly and it will immediately unlock and open all the doors you ever wanted to (or not) 🔐
Glitch: The wily intruder has dropped a payload on the target servers. The payload is some kind of backdoor script or malware small enough to be downloaded and executed without attracting attention. The backdoor applies the instructions and attempts to move laterally inside the network, scanning and breaking into other hosts until it finds a valuable target. How to make it move downward whereby the intruder can be exposed and contained? 🚧
Magic Spell: Calmly utter the word Descendo, which will cause the target object to move downward 🚧
Glitch: Most applications need to receive some kind of secret as part of their configuration. How would such a service receive the cryptographic keys needed to encrypt the data, and do so in a way that quickly limits services with secrets whose size exceeds the maximum length of environment variables? 🐡
Magic Spell: Wryly repeat the word Engorgio, which will engage the Engorgement Charm, causing objects to increase in size 🐡
Glitch: Cloud providers often provide a mechanism by which a transferred key provides no more security than if we had passed decrypted configuration files directly. They (i.e. cloud providers) also provides a solution to this problem through its Key Management Service (KMS), a cryptographic service. But how to efficiently apply this to (seed) objects chosen at random? 🐉
Magic Spell: Simply utter the word Portus, and witness any old object transform into Port keys! 🐉
Glitch: What kind of a method, statistical or otherwise, can help reduce the noise in the data, and only trigger alerts when clients violate predefined thresholds? 🙊
Magic Spell: No problem, just say Silencio to make interfering noise go silent 🙊
Glitch: Information-disclosure threats are a royal pain because they involve exposing information to individuals who aren’t supposed to have access to it—for example, the ability of users to read a file that they weren’t granted access to, or the ability of an intruder to read data in transit between two computers. How to make the guilty party levitate and thereby divulge their identity? 🐝
Magic Spell: Love this spell rolling off of my tongue each time I utter Wingardium Leviosa and engage the Hover Charm, which causes an object—any object, oh yeah!—to levitate 🐝
Hey, what about Muffliato, the spell used to prevent conversations from being overheard by filling the ears of those nearby with an unidentifiable buzzing noise?
4. Charles Dickens Is Beguiled By Clock Synch 🎥
It was the best of times, it was the worst of times; it was the best of times because the US Women’s Soccer Team, the trailblazing American patriots led by Megan Rapinoe, had chalked up another awesome victory by winning the Women’s World Cup 2019, and it was the worst of times because a bug had been discovered in NTP (the Network Time Protocol), whose clock synchronization between computer systems over packet-switched, variable-latency data networks was found to unravel ever few milliseconds 📬
It was the age of wisdom, it was the age of foolishness; the age of wisdom because the industry as a whole remained firmly committed to developing software according to SOLID principles, and the age of foolishness because people everywhere foolhardily kept looking for free lunches despite being upbraided for paying scant attention to Moore’s law having maxed out! 🐭
It was the epoch of belief, it was the epoch of incredulity; deep belief networks in general and deep learning in particular had powered us smack into the frenzy of a genuine revolution, but fake news was scorching and gaslighting the soul of society, not to mention the fruits of the aforesaid revolution serving such lofty pursuits as turning to social media in general and fake-books in particular to find out whose pet’s coiffure had garnered the most likes that day 🐩
It was the season of Light, it was the season of Darkness; lightweight, agile development approaches had gained traction, but our society remained benighted by the ever-stretching shadow cast by the moving target that is code bloat 🎃
It was the spring of hope, it was the winter of despair; functional programming, along with the arrival of the remarkable Go programming language, had sprung on us from unbeknownst quarters, but feature creep, alas, was not going away anywhere, anytime soon 🐾
We had everything before us, we had nothing before us; quantum computing was on the horizon, but our entire stash of Domino’s Pizzas coupons had expired 😧
We were all going direct to Heaven, we were all going direct the other way; domain-driven development was gently leading us away from the yellow brick road, but the telltale footprints of DLL hell, sigh, had not tiptoed away, yet 🚁
In short, the period was so far like the present period, that some of its noisiest authorities insisted on its being received, for good or for evil, in the superlative degree of comparison only; ah yes, notwithstanding how Twitter had, to its everlasting credit, contributed the amazing Apache Storm stream processing software framework to open source, the social media platform that it powers had, alas, been hijacked by some of the noisiest rabble-rousers imaginable 🚑
5. Thoreau Does Refactoring, Thoroughly 🚂
While the strategies associated with refactoring—that’s the process of changing a software system in such a way that it does not alter the external behavior of the code yet improves its internal structure—were conceived in Smalltalk circles, it wasn’t long before they found their way into other programming language camps. In particular, another camp which refactoring strategies made their way into was the one which Henry David Thoreau had set up on the shores of Walden Pond (It was actually a wood cabin, but that’s merely a minor detail, amirite?)
Anyhow, I’m here today to tell you the unknown story of how Thoreau immersed himself in a bunch of refactoring tactics—and yes, I meant to say tactics, not Tic Tacs. Here, then, by popular demand, in “Problem-Solution” format, is a segment of that story (Hey, I can’t give all of it away now!)
Problem #1: [The Code Smell here is: Primitive Obsession] You see, and so said another sage by the name of Martin Fowler, “people new to objects usually are reluctant to use small objects for small tasks….” 📮
Solution #1: Consider the wise words of the Sage of Concord (more like a problem restatement, if you ask me, but…) when he said, “White Pond and Walden are great crystals on the surface of the earth, Lakes of Light. If they were permanently congealed, and small enough to be clutched, they would, perchance, be carried off by slaves, like precious stones, to adorn the heads of emperors; but being liquid, and ample, and secured to us and our successors forever, we disregard them, and run after the diamond of Kohinoor. They are too pure to have a market value; they contain no muck. How much more beautiful than our lives, how much more transparent than our characters, are they!” 📮
Problem #2: [The Code Smell here is: Bad Smells in Code] Kent Beck and Martin Fowler “If it stinks, change it.” Grandma Beck—relation of legendary programmer Kent Beck—discussing child-rearing philosophy 👶
Solution #2: Aha, this one is simple if you only hearken to the words of Thoreau when he said, “What is the pill which will keep us well, serene, contented? Not my or thy great-grandfather’s, but our great-grandmother Nature’s universal, vegetable, botanic medicines, by which she has kept herself young always, outlived so many old Parrs in her day, and fed her health with their decaying fatness. For my panacea, instead of one of those quack vials of a mixture dipped from Acheron and the Dead Sea, which come out of those long shallow black-schooner looking wagons which we sometimes see made to carry bottles, let me have a draught of undiluted morning air. Morning air!” So there you go, in two words: “Morning air!” 👶
Problem #3: [The Code Smell here is: Lazy Class] Again, in the words of the eminently fine gentleman Martin Fowler, “A class that isn’t doing enough to pay for itself should be eliminated. Often this might be a class that used to pay its way but has been downsized with refactoring. Or it might be a class that was added because of changes that were planned but not made. Either way, you let the class die with dignity.” 🐢
Solution #3: A bit more abstract than what we’ve seen so far, but not rocket science either if you follow Thoreau when he opined that, “The greatest gains and values are farthest from being appreciated. We easily come to doubt if they exist. We soon forget them. They are the highest reality. Perhaps the facts most astounding and most real are never communicated by man to man. The true harvest of my daily life is somewhat as intangible and indescribable as the tints of morning or evening. It is a little star-dust caught, a segment of the rainbow which I have clutched.” 🐢
Problem #4: [The Code Smell here is: Inappropriate Intimacy] “Sometimes classes become far too intimate….” 💕
Solution #4: A (seemingly) tough nut to crack, but only so if you forget what the Sage of Concord reminded us pithily when he said, “One inconvenience I sometimes experienced in so small a house, the difficulty of getting to a sufficient distance from my guest when we began to utter the big thoughts in big words. You want room for your thoughts to get into sailing trim and run a course or two before they make their port. The bullet of your thought must have overcome its lateral and ricochet motion and fallen into its last and steady course before it reaches the ear of the hearer, else it may plow out again through the side of his head. Also, our sentences wanted room to unfold and form their columns in the interval.” 💕
6. The Brothers Grimm Tell A Silicon Valley Tale 🎭
Once upon a time, many, many moons ago, a critical mass of physicists—you know, the kind of scientists who wear white overcoats and scurry around corporate laboratories and clean rooms as if they’re engaged in stuff of paramount importance?—had a bunch of time on their hands and decided to invent the electronic transistor.
And thus was born the modern digital world. Remember the magic beans that Jack planted in his backyard? And how that bean stalks grew and grew and grew? Yep, so did the transistor emerge from the laboratories and start making its way into applications that nobody could have imagined. And its applications branched out. In fact, their reach was incredibly diverse, and their applicability just grew and grew and grew as if there was no tomorrow.
Fast-forward a bunch of decades—and I mean a ton of decades—and we got ourselves computer programs outstripping their fledgling status and become super-sophisticated beasts in their own right. These trends continued right up till this very day when we find deep learning having taken the industry by storm; the allied technology is so advanced that it fulfills each one of Arthur C Clarke’s Three Laws, especially the third one (“Any sufficiently advanced technology is indistinguishable from magic“).
Oh yes, a bunch of industry sectors nowadays depend on deep learning algorithms—all traceable to the back propagation algorithm, the stuff of my MS thesis from many moons ago—which map inputs to outputs by forming nonlinear mappings of immense complexity, complexity which computer scientists at the forefront of the field are furiously tackling so as to reverse engineer their inner workings.
Oh my, how our beanstalk grew!
But wait, isn’t there supposed to be a big, bad giant in the story, the one that Jack had to escape to save in his life? Yes, George Orwell foretold a big part of that in his dystopian novel named 1984. Big Brother is watching us; maybe it’s that giant of beanstalk infamy himself. He ain’t no brother of mine, though!
Tell you what, everybody lived happily ever after—we’re talking fairy tales, for crying out loud. Except there’s a warning, which is this: We’ve got to make sure that we don’t get done in by deep fake technology; and you thought we had it bad enough with fake news swirling around!