Posts tagged “locking”

  1. Should you lock the row or retry on conflict?

    Pessimistic locking (SELECT … FOR UPDATE) vs optimistic retries (a version column) vs a single atomic UPDATE, measured on PostgreSQL 17 at high and low contention, plus 50 buyers rushing the last 10 tickets.

    · 12 min read · Databases