Every backend eventually needs the same primitive: run this job on exactly one
instance at a time. A nightly report. A poller that shouldn't fire twice. A
reconciliation job that would corrupt data if two copies raced each other. The
need is boring and universal β which is exactly why it's strange how heavy the
usual answers are.
ZooKeeper / Consul / etcd β a whole coordination service to run, monitor, and page someone about, just so a job doesn't double-fire.
Redis Redlock β a new dependency, and its correctness under partition and clock skew has been debated in public for years.
SELECT ... FOR UPDATE β fine for a lock held for one transaction. Wrong shape for "hold this for the next 20 minutes" β it blocks other queries and a hung connection holds the lock forever.
If you already run Postgres or MySQL, none of that is necessary.β¦