Sometimes you just need ‘only one worker does this thing at a time’, and building distributed locks from scratch is risky. Postgres advisory locks are a pragmatic option when your DB is already the source of truth. I derive a deterministic lock key (like org:123:billing-run) and attempt to acquire it with pg_try_advisory_lock. If I can’t, I skip the work and let the existing worker finish. The key is keeping lock scope small and releasing reliably with try/finally. I also avoid holding advisory locks across long network calls. Used carefully, this prevents duplicate background runs without adding extra infrastructure.