Bird
Raised Fist0

How would you design a scalable hold system to handle millions of concurrent users holding items with expiration?

hard📝 Trade-off Q8 of Q15
LLD - Design — Library Management System
How would you design a scalable hold system to handle millions of concurrent users holding items with expiration?
AStore all holds in a single database table without indexing
BManually check holds on every user request
CUse client-side timers to track hold expiry
DUse distributed cache with TTL and a background cleanup service
Step-by-Step Solution
Solution:
  1. Step 1: Identify scalability needs

    Millions of users require fast, distributed, and efficient hold tracking.
  2. Step 2: Choose appropriate technology

    Distributed cache with TTL (time-to-live) automatically expires holds; background cleanup ensures consistency.
  3. Final Answer:

    Use distributed cache with TTL and a background cleanup service -> Option D
  4. Quick Check:

    Scalable hold system = distributed cache + TTL [OK]
Quick Trick: Distributed cache with TTL handles large scale holds efficiently [OK]
Common Mistakes:
MISTAKES
  • Using single DB table causing bottlenecks
  • Relying on client-side timers which are unreliable
  • Checking holds on every request causing overhead

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes