Overview
by Aarti Gupta
We needed locks so queue workers did not process the same job twice.
Redis SET NX was faster under load and easy to expire automatically.
Postgres advisory locks were simpler operationally for our small team.
Failover behavior mattered more than raw latency in our case.
We chose Postgres first, then moved hot paths to Redis later.
Pick the lock store you can operate confidently at 3am.