Design Read-Only Review Keyword Search
Design low-latency conjunctive keyword search over a fixed corpus of one hundred million reviews.
Problem statement
For this exercise, assume a fixed corpus of 100 million immutable review documents has already been accepted for publication. A client submits one to eight normalized keywords and receives every review containing every keyword, ordered by review ID, through stable cursor pagination.
The corpus is read-only during an index generation; a separately built generation becomes visible only through an atomic manifest cutover, and cursors remain bound to their original generation until expiry. Empty or malformed queries return explicit errors.
Every accepted query can continue page by page until all matching reviews have been returned; the system may bound page size, concurrent work, and request rate, but it must not truncate the result set.
Assume 20,000 queries per second, p95 first-page latency below 150 milliseconds, bounded response pages with no terminal result-count cap, and one regional failure without losing an acknowledged index generation.
Ranking, fuzzy matching, personalized relevance, review writes, moderation, and natural-language understanding are outside scope.
What to build
- A client can search for reviews containing every normalized keyword and receive deterministic review-ID ordering.
- Pagination remains stable within one immutable index generation even while a newer generation is activated.
- The service bounds each response page and protects capacity with resumable work, quotas, and rate limits while allowing every accepted query to enumerate all matches; invalid, stale-cursor, and unavailable outcomes remain explicit.
- An acknowledged index generation survives one regional failure and can be verified against its source manifest.
At scale
- The fixed corpus contains 100 million immutable reviews and requests contain one to eight keywords.
- Twenty thousand queries per second and p95 first-page latency below 150 milliseconds are authored practice assumptions.
- Each response page is bounded, while a stable cursor can enumerate every matching review ID without truncation.