CSE Roadmap

Core tier · about 3 hours · 7 parts

Part 6 of 7 · 2 min read

The trade-offs

What this design gives up, stated out loud.

The trade-offs

Think of stating trade-offs out loud like a contractor telling a client exactly which corners were cut to hit the budget, rather than letting the client discover them later.

In plain words: This design accepts several explicit trade-offs. First, SKIP LOCKED means a customer does not get to claim a specific seat by number through this claiming step alone. It is suited to "any available seat in this price tier" flows. A true seat-map picker needs a direct row lock on the one chosen seat instead, accepting more contention on popular individual seats in exchange for letting a customer pick exactly which one they want. Second, the short hold window trades customer convenience against seat availability: a longer window is friendlier to a slow typist, but it also locks seats away from other buyers for longer. Third, this design assumes a single-database, single-region deployment. A globally distributed version would need to decide how holds are coordinated across regions, reintroducing the distributed-transaction trade-offs covered earlier in this subject.

Trade-off statement (interview habit)

A trade-off statement names explicitly what a design choice gives up, not only what it gains, stated as a deliberate decision rather than left for a reviewer to discover.

Example: stating plainly that SKIP LOCKED fits "any seat in this tier" but not "this exact numbered seat" is a trade-off statement, not an afterthought.

Quick notes

  • Start with requirements and rough numbers; here, the contention ratio of concurrent buyers to seats is the number that actually predicts the real bottleneck.
  • A correct naive design can still fail under load for a throughput reason, not a correctness one; identify which before proposing a fix.
  • SELECT FOR UPDATE SKIP LOCKED lets many workers claim distinct rows from a shared pool in parallel without queueing behind each other.
  • A short, bounded hold window limits how long contention and unavailability last after an abandoned selection.
  • State a design's trade-offs explicitly, out loud, rather than presenting only its benefits.