Design brief

Design search for 100 million documents with 2 KB of searchable text each and 5,000 queries per second. Queries should usually finish within 200 ms; updates may take a few seconds to appear. Deletes must not be undone by older updates. With 20 shards, unpruned queries create roughly 100,000 shard requests per second. State freshness, completeness, and relevance expectations before choosing partitioning.

Draw and explain

Use Excalidraw to separate authoritative documents, change ingestion, derived indexes, and query serving. Label document versions, shard ownership, searchable generations, access checks, and durable rebuild sources. Trace an accepted update to searchable visibility, then a query through candidate selection and global result merging. Explain score comparability, tie-breaking, and what the response says when a shard misses its deadline.

Stress the design

A delete is indexed, then an older update arrives from replay. Show why the document stays deleted and how long the required ordering evidence survives. Next, slow one shard during a query. Draw deadline handling and the user's observable completeness contract without exceeding the latency budget silently.

Review your design

Compare shard count with fanout cost, skew, and recovery time. Explain read-after-write options, safe index-generation replacement, and temporary rebuild storage. Check authorization before candidate truncation and cache scope. Choose signals for ingestion lag, stale-event rejection, refresh age, partial queries, and tail latency.

Capture assumptions, sizing, and the tradeoffs behind your diagram.

Review is your own assessment of the design.

Drag or use the arrow keys to resize. Home collapses the brief; End collapses the canvas. Enter or double-click resets the split.
Loading drawing…