Bird
0
0

You need to design a scalable rating and review system that supports millions of products and users. Which approach best handles high read traffic for average ratings?

hard📝 Trade-off Q8 of 15
LLD - Design — Food Delivery System
You need to design a scalable rating and review system that supports millions of products and users. Which approach best handles high read traffic for average ratings?
ADisable caching and rely on database queries only
BCalculate average rating on the fly by scanning all reviews each time
CStore reviews only in a flat file on disk
DPrecompute and cache average ratings in a fast key-value store
Step-by-Step Solution
Solution:
  1. Step 1: Understand read traffic challenge

    Millions of users reading ratings cause heavy load if computed live.
  2. Step 2: Choose caching strategy

    Precomputing averages and caching them reduces database hits and speeds reads.
  3. Final Answer:

    Precompute and cache average ratings in a fast key-value store -> Option D
  4. Quick Check:

    High read scalability = Use caching [OK]
Quick Trick: Cache computed averages to reduce database load [OK]
Common Mistakes:
  • Calculating averages live for every request
  • Using flat files which are slow for queries
  • Disabling caching increases latency

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes