Where database blog posts get flame-broiled to perfection
Ah, a blog post. How... democratic. One must extend a modicum of credit to the practitioners over at MongoDB. It seems theyâve finally stumbled upon the rather elementary problem of stale reads in a leader-based system. A charming discovery, to be sure, and one we cover in the second week of my introductory course. It is heartening to see industry catching up, even if it is a quarter-century behind the literature.
Their central "innovation," this "LeaseGuard," is presented with such breathless enthusiasm. "The log is the lease," they declare. Such a plucky, provincial little phrase. It has the distinct ring of an engineer who, having only a hammer, triumphantly declares that every problem is, in fact, a nail. The commingling of concepts is a classic tell; a desperate dance to avoid the far more rigorous work of treating them as the orthogonal concerns they are. Durability and temporal authority are cousins, perhaps, but they are most certainly not twins. Conflating them is a path laden with peril and perverse performance puzzles.
And the optimizations! My goodness, the optimizations.
First, the "deferred-commit writes." A clever trick. They've managed to hide the unavoidable latency of a leadership transition by, essentially, making the queue longer. It's a marvelous bit of theatrical sleight-of-hand. One is reminded of a child who, when told to clean his room, simply shoves everything under the bed. The room appears clean, for a moment, and the throughput chart certainly reflects this valiant effort. Superb.
But the piĂšce de rĂ©sistance, the absolute zenith of this well-meaning mediocrity, is the "inherited lease reads." Oh, itâs a beautiful construction, provided one is willing to ignore the colossal caveat casually tucked away in a subordinate clause: 'requires synchronized clocks with known error bounds'. My dear colleagues, have we learned nothing? This isn't an innovation; it's a Faustian bargain, trading the purity of algorithmic correctness for the fleeting, fickle phantom of synchronized time.
But what if there was a way for both leaders to serve reads, and still guarantee Read Your Writes?
One reads this and can only sigh. They've tiptoed right up to the very edge of the CAP theorem, peered into the abyss, and decided to build a bridge out of wishful thinking. Clearly they've never read Stonebraker's seminal work on the fallacies of distributed computing, or perhaps they simply found it too... taxing. To sacrifice the 'P' in CAP for a sliver more 'A' by leaning on synchronized clocks is not a breakthrough; it is a well-documented compromise that we guide our graduate students to avoid.
And it is almost touching to see them cite their inspiration: 'a forum post from Archie Cobbs.' A forum post! Not Lamport, not Lynch, not Brewer. A missive from the digital ether. One weeps for the decline of scholarly citation.
Their giddy excitement at discovering TLA+ is also rather telling. "We probably wouldnât have realized it was possible if TLA+ wasnât helping us think." Indeed. It's wonderful that they've discovered that formal methods can, in fact, prevent one from building a distributed system that immediately immolates itself. A gold star for doing the absolute bare minimum of due diligence. Their subsequent foray into 'reasoning about knowledge' suggests they are on the cusp of discovering the entire field of epistemic logic. We await their forthcoming blog post on the "muddy children puzzle" with bated breath.
All told, it's a truly impressive series of patches for a flat tire. One almost forgets the goal was to invent a better car.