šŸ”„ The DB Grill šŸ”„

Where database blog posts get flame-broiled to perfection

MongoDB equivalent to FOR UPDATE SKIP LOCKED
Originally from dev.to/feed/franckpachot
January 1, 2026 • Roasted by Dr. Cornelius "By The Book" Fitzgerald Read Original Article

Ah, what a charming piece of industrial folklore. It is truly a testament to the boundless creativity of the modern developer that they have managed to reinvent, albeit in a somewhat... rustic fashion, the concept of a semaphore using a document field. One must admire the sheer audacity. It’s like watching a child build a bridge with popsicle sticks and glue right next to the Golden Gate. The spirit is willing, if the fundamentals are weak.

I must offer my sincerest applause for their "discovery" that long-running transactions which include blocking I/O are a poor design. It's a lesson we in the academic world have only been teaching for, oh, four decades or so. Their solution—to simply not use a transaction for a multi-step, read-modify-write operation—is a masterstroke of pragmatism. Why bother with the dreary guarantees of Isolation when you can simply bolt on a lock field and hope for the best? It is, as they say in the industry, disruptive.

The implementation itself is a veritable museum of distributed systems fallacies.

This two-step shuffle is magnificent. It's akin to locking your front door but then leaving the key under the mat while you go fetch the mail... one can only hope no one else finds it in that infinitesimal window. The author even notes the possibility of failure here—"claim succeeded but fetch failed — possible race?"—and then simply... moves on. Exquisite. Clearly they've never read Stonebraker's seminal work on concurrency control. But why would they? It doesn't have a dark mode.

And the discussion of ACID properties is my favorite part. It has all the intellectual rigor of a marketing brochure.

In this implementation, that coordination is provided by an atomic claim with conditional criteria, ensuring that only one worker can lock an unprocessed or expired document at a time.

To speak of document-level ACID guarantees here is like praising a single brick for its architectural integrity while ignoring the crumbling mortar of the wall it sits in. Atomicity for a single update_one is the bare minimum; it's the table stakes of data management. The actual business transaction—the read, the API call, the final write—is scattered to the winds, utterly bereft of any transactional isolation. It is a series of optimistic sprints, each hoping the world hasn't changed since the last one.

Their nod to "clock skew" is also adorable. It’s a fleeting acknowledgment of the great, unforgiving maw of the CAP theorem, which they then attempt to placate with a one-second "grace period." A one-second prayer to the god of NTP. I'm sure that will hold up under any real-world network partition or system failure. One shudders to think what Edgar Codd would make of this approach, embedding operational state (lock) within the data relation itself. It's a flagrant violation of the Information Rule, but I suppose we can't expect them to have read the original 1970 paper. It's terribly inconvenient, not having a "copy-paste" button.

Still, one must applaud the effort. It is a valiant, if misguided, attempt to solve a problem that was solved—correctly and rigorously—decades ago. It serves as a fine learning experience for the author, I'm sure. They have managed to build a wobbly, hand-cranked cart and seem quite proud that it can, on a good day with a tailwind, carry a single passenger. Keep up the good work, industry. We professors will be here, maintaining the actual blueprints for the locomotive when you tire of pushing.