← All questions
System DesignVery Hard· data erasure deadline· index rebuild latency· scalability· per‑record compliance

Legal now requires erasure within 24 hours, and your in...

First, translate the new legal constraint into a quantitative requirement: a 24‑hour erasure deadline on a corpus that is 50 × larger than the current 10 M‑document baseline means a full index rebuild would now require about 50 hours (50 × 1 hour). Consequently, a nightly full rebuild is mathematically impossible and cannot satisfy the legal deadline. The appropriate response is to redesign the system so that erasure is handled at the granularity of individual records—e.g., by maintaining a delete‑list, using a mutable posting structure, or employing incremental updates—rather than relying on a complete nightly rebuild. This reframes the problem from a whole‑index rebuild to a per‑record compliance obligation.

Code playground (Python)