Does modern isolation techniques help reduce contention for highly contended counter updates?
11:10 27 Dec 2025

We maintain counters in a relational database where each incoming request increments or decrements a counter, subject to a maximum limit.

Throughput is 300 requests per second, and many (or all) requests may target the same counter.

For correctness, each request currently performs the following synchronously in a single transaction -

Read the counter to check whether it can be incremented further.
Insert a log entry representing the delta.
Update (increment/decrement) the counter row.

The main issue is high contention: when many transactions update the same counter row, row-level locks cause updates to serialize, leading to increased latency.

Can using more advanced transactional techniques—such as Serializable Snapshot Isolation (SSI) or other MVCC-based approaches—significantly reduce contention and improve throughput for this kind of highly contended counter update, while still keeping the updates synchronous in the same transaction, If SSI/MVCC does not meaningfully help here, what class of approaches do real systems typically use instead ?

database postgresql transactions isolation-level