Deadlocks and downtime
Jul 8, 2026Simeon Griggs

Summary
This post details how deadlocks occur in Postgres, the damage they cause (backed-up transactions and retry storms), strategies to reduce their likelihood in queries (consistent lock ordering, shorter transactions, reducing latency via indexing), application-level retry logic with backoff and jitter, observing deadlock errors in the PlanetScale dashboard, and using Traffic Control with Resource Budgets to mitigate deadlocks at the database level by limiting concurrent query execution.