The Lock You Did Not Know You Were Taking
A read endpoint was taking row locks for 400ms at a time because of one FOR UPDATE, and nothing in the code looked like a write. Here is how that happens and what to grep for.
Tag archive
A read endpoint was taking row locks for 400ms at a time because of one FOR UPDATE, and nothing in the code looked like a write. Here is how that happens and what to grep for.
A single atomic migration script cannot keep a site up. Old and new code must both work against the schema during rollout, so the change belongs in two deploys.
Introduction In the previous article, we learned why databases need locking and how...
Database Deadlocks: Detection, Diagnosis, and Prevention A deadlock happens when two or...
Deadlock detection: vì sao Postgres chỉ dò cycle sau deadlock_timeout, và vì sao retry mù...
FOR UPDATE: pessimistic row lock để chặn lost update, và cái giá deadlock khi không lock...
Production lock analysis: vì sao pg_stat_activity một mình không đủ, và join với pg_locks...
Lock trong Postgres: hai tầng heavyweight/lightweight, vì sao một ALTER đứng yên kéo theo cả...
DDL lock: vì sao một ALTER TABLE 50ms vẫn đủ làm sập cả API trong giờ cao điểm DDL trong...
Goal of this article: Build a strong foundation before learning pessimistic locking, optimistic...
When building distributed systems or breaking down an existing monolithic system, managing...
How to Implement Distributed Locking with Redis 8 and Go 1.23 for...