Preparing your design workspace

Loading the problem and your latest saved attempt…

Design a Cached Astrologer Listing Service

Design a freshness-bounded profile-listing service that uses Redis for hot reads while surviving stampedes and cache outages without overwhelming its database.

Problem statement

For this exercise, assume clients request bounded pages of active astrologer profiles using optional region and language filters, deterministic profile-ID tie breaking, and an opaque cursor. An existing trusted operator feed creates, updates, activates, or deactivates profiles in an authoritative database.

Redis is derived acceleration, not authority; cached responses identify their data version and expiry, and an accepted profile change must appear in listings within 30 seconds. During a Redis outage, the database can sustain at most 5,000 fallback listing reads per second.

Excess work must be coalesced, served from a still-valid local snapshot, or rejected explicitly rather than overwhelming the database. Profile details are already authorized for listing. Exclude personalized ranking, booking, payments, chat, reviews, profile-authoring UI, and full-text search.

What to build

  1. A client can read a bounded cursor-paginated list of active astrologer profiles with optional region and language filters.
  2. A trusted operator feed can create, update, activate, or deactivate an authoritative profile.
  3. An accepted profile change becomes visible in matching listings within 30 seconds without an older cache refill regressing the result.
  4. The service can continue a bounded subset of listing reads during a Redis outage while protecting the authoritative database and returning explicit overload outcomes.

At scale

  • Sustain 50,000 listing reads and 2,000 profile changes per second, with one popular query reaching 10,000 reads per second.
  • Return healthy cached listing reads within 200 milliseconds at p99.
  • Make accepted profile changes visible in matching listings within 30 seconds.
  • Limit direct database fallback during a Redis outage to 5,000 listing reads per second and shed or coalesce excess work.