Build1 distinct publisher3 min readUpdated
A dev.to series on distributed locking reaches the concession worth reading: exclusive ownership is rarely the problem, and hardening a lock rebuilds leader election with the expensive part kept.
The Engineer · Build desk

Compiled by The EngineerSomething wrong?How this is made
The third instalment of a dev.to series on distributed locking in practice arrives at the concession most teams reach late: exclusive ownership is not always the problem being solved, because in many systems the goal is simply that one machine coordinates the rest [4]. That matters because the standard hardening path for a lock, leases first and then fencing tokens, ends up reconstructing leader election while keeping the costly part [2][3].
Follow the progression as the piece lays it out. A distributed lock coordinates ownership of a resource across machines so that only one node acts on it at a time [1]. Crashed or unreachable holders leave locks abandoned, so ownership becomes a lease: temporary, and expiring unless renewed [2]. Stale owners, nodes that still believe they hold the lock, then get fenced, with a higher-numbered token blocking unsafe updates from the older holder [3]. Each addition is a correct response to a real failure mode. Collectively they change what you are holding. Expiring ownership, plus a monotonically increasing token, plus failover when the lease lapses, is the shape of leadership with an epoch number, and the residual difference is how often you re-run the handoff [14].
The worked example is one most scheduler teams have shipped: identical instances, each checking every minute whether invoices should be generated, with duplicate invoices inevitable if they all proceed [5]. The lock version is correct, and it pays a coordination round on every execution cycle [6]. At the stated one-minute cadence that is about 1,440 contended acquisitions per day [15], for a responsibility that does not move: one instance should own scheduling, and that assignment does not change frequently [7].
Leader election prices the same requirement differently. The cluster elects one coordinator, the others keep serving requests and stop competing unless a failure occurs [8]. The question shifts from who owns this operation right now to who is currently the leader of the cluster [10], and that leader can absorb the other work that wants a single owner anyway: cluster state, assigning work to nodes, health monitoring, shared configuration [9]. Election runs when leadership is lost, not per operation [12].
This is not a free safety upgrade, and the article does not sell it as one. Leaders crash, and when one does the cluster has no coordinator until a new leader is elected [11]. The exposure moves rather than disappears: from two nodes believing they hold the same lock, to an interval in which nobody is coordinating at all [17].
Which is where the published text runs out. The piece raises the right follow-up, how the system knows the leader has actually failed, and the text breaks off mid-sentence at "The honest answer is that it does" [13]. Failure detection is the load-bearing component of every design above, and it is the one left unwritten in part three of four [16].
Two things to watch. First, whether the concluding instalment puts numbers on detection: renewal intervals, timeout margins, and what the cluster does during the gap [13]. Second, a diagnostic you can run on your own system this week: if your lock acquisition rate is roughly constant and the winner is nearly always the same instance, you are holding an election every cycle and paying contention for a decision that is not actually in dispute [6][7].
Follow any of these and your For You feed starts watching them — no settings page required.
Ranked by verification strength, evidence, and original report placement.
In the lock-based solution, each instance attempts to acquire the lock before running the scheduler and the winner proceeds while others wait; this works correctly but every execution cycle requires coordination, producing a repeating pattern of contention.
The article states the real requirement is that only one instance should be responsible for scheduling, that this responsibility does not change frequently, and that continuously competing for it introduces unnecessary overhead.
With leader election, the cluster elects a single instance to act as coordinator; the other instances continue serving requests and no longer compete for leadership unless a failure occurs.
Once elected, the leader takes responsibility for shared tasks including scheduling background jobs, coordinating cluster state, assigning work to nodes, monitoring cluster health, and managing shared configuration.
The coordination question changes from "Who owns this operation right now?" to "Who is currently the leader of the cluster?", making leadership a long-lived role rather than a short-lived lock acquisition.
Leader election does not remove failure scenarios: if the leader crashes unexpectedly the cluster loses its coordinator, with no node actively managing scheduling or coordination until a new leader is elected.
Evidence-backed comparisons of source perspectives and observed adoption signals. Read the methodology
Which Builder, Operator, and Investor concerns the observed source mix emphasized—not a truth score.
Evidence, demonstrated adoption, hype gap, incentives, and confidence are assessed independently, each on its own current evidence. How these are measured.
One explanatory post, self-referential only
Every claim traces to a single dev.to instalment that reasons from first principles with ASCII diagrams. The internal logic is consistent and the article is candid about its own limits (failure detection is uncertain; election is not consensus), but there is no second source, no benchmark, no incident report and no measurement of the contention overhead that motivates the whole argument. Evidence quality is adequate for a conceptual model and weak for any operational or architectural decision.
No adoption signal in supplied material
The source is a conceptual explainer. It names no product, service, library, version or deployment, reports no usage, and describes no incident or benchmark. Nothing in the supplied material indicates whether anyone has adopted either coordination pattern in the way described, so adoption cannot be scored without inventing facts.
Mildly overstated: 'better alternatives' asserted, never measured
The series bills leader election as a 'better alternative' and the story framing pushes further, calling a hardened lock a badly timed election. The article itself is more restrained and even undercuts the framing - it says leader election still depends on leases, heartbeats and timeouts, still cannot tell a crash from a partition, and is not consensus. The overstatement is therefore modest and comes from the packaging and the unquantified overhead claim, not from false technical assertions.
Series-audience incentive, no commercial stake visible
The visible incentive is authorship of a numbered 4-part explainer on a developer publishing platform: continuation and audience-building reward a clean narrative arc from locks to leases to fencing to leadership, which plausibly explains the unquantified 'better alternatives' framing. No vendor, sponsor, product, pricing or licence interest appears anywhere in the supplied text, so commercial distortion pressure is low.
Confident on what was said, thin on whether it generalises
Confidence in the reading of the text is high: the body is complete through section 18 and the claims are direct restatements or simple arithmetic. Confidence in the substantive conclusion is limited by a single publisher, absent adoption evidence, an unmeasured overhead premise, and one ledger observation (text breaking off mid-sentence) that the supplied body contradicts.
build
Most distributed locks are a design smell: give one thing ownership, skip the protocol1 distinct publisher
build
Force the tool call, then hand Lightsail a long-lived key1 distinct publisher
build
AI-written code fails the same four ways, and every gate you own reports green1 distinct publisher
build
CSA's 2026 threat list is a flat line, so ask which threats a config snapshot can prove1 distinct publisher
Distinct publishers with included, body-backed reporting in this cluster.
dev.to
1 article · August 19, 2026