Where's the Next 100x?

Concept. Choose the next optimization by measuring contention, I/O, and coordination costs. Finer-grained locks, LSM storage, and timestamp ordering address different costs. They can be combined; none guarantees a fixed speedup.

Intuition. Updates to separate fields may benefit from smaller locks. A stream of listening events benefits from batching writes. Transactions that conflict still need a concurrency-control rule.

Three ways to improve throughput: reduce contention, batch writes, or change concurrency control.

Figure 1. Choose the change that addresses the measured bottleneck. Improving Strict 2PL and choosing another protocol are both options.

The Opportunity Space

Strict 2PL accepts a subset of conflict-serializable schedules, which are a subset of serializable schedules. Other protocols can admit different schedules, but the larger set alone does not tell us the performance gain.

Nested hierarchy: S2PL inside 2PL inside Conflict-Serializable inside Serializable

Figure 2. Serializability is the correctness target. A scheduling rule may be more restrictive to make correctness practical to enforce.

Match the Protocol to the Workload

Three workload choices: finer-grained locks, LSM storage, and timestamp ordering, each with a trade-off.

Figure 3. These mechanisms solve different problems. LSM storage does not replace transaction concurrency control.

  • Many users update independent fields. Smaller locks can reduce unnecessary blocking. Updates to the same counter still serialize; changing the lock size does not remove that conflict.

  • A song receives 10M plays in an hour. An LSM tree buffers events, flushes sorted files, and compacts them later. The trade-off is extra work during reads and compaction, not necessarily delayed visibility. Transactional updates still need coordination.

  • Transactions must respect a timestamp order. A basic timestamp-ordering protocol rejects operations that violate the order. Retrying aborted transactions is part of the cost.

Real systems combine mechanisms. RocksDB supports both optimistic and pessimistic transactions; Spanner combines timestamps with concurrency control.

The Next Machine

Measure the bottleneck, choose a mechanism, then account for communication and failures when distributing the work.

Figure 4. Distributed systems add communication and partial failures to the same correctness and performance questions.