tutorials35 min read
Why Checkout Locks Up on Black Friday: Waiting for Payment Inside a Transaction, and Hot Rows
On Black Friday night checkout takes seconds and product pages slow down too, yet neither the API's nor the database's CPU is busy. We follow row lock waits step by step: a transaction that waits on the payment service while holding a lock, why pg_stat_statements counts lock waiting as execution time, and the fix that cuts lock time from half a second to tens of milliseconds.