Design a Million-Domain Blocking Service
Distribute and evaluate a million-domain block policy with fast decisions, bounded staleness, and safe cache updates.
Problem statement
Design a service that lets authorized policy owners maintain a blocklist of up to one million internet domains and lets clients decide whether a requested hostname is blocked.
For this exercise, assume exact domains and optional subdomain rules, internationalized-domain normalization, ten million intermittently connected clients, and a control plane that publishes versioned policy snapshots plus ordered deltas.
Clients should usually decide from a local cache, must expose the policy version used, and need an explicit fail-open or fail-closed policy when their data is stale. Policy edits require audit history and rollback.
Page-content classification, URL-path filtering, malware detection, and network-packet transport are outside scope.
What to build
- Authorized owners can add, remove, review, publish, and roll back normalized domain rules as immutable policy versions.
- Clients can bootstrap a complete snapshot, receive ordered deltas, detect gaps, and recover after being offline.
- Clients can evaluate exact-domain and subdomain rules locally with predictable latency and return the matched rule and policy version.
- Operators can measure rollout freshness, cache health, decision errors, and policy impact while preserving a complete change audit.
At scale
- For this exercise, assume one million active rules, ten million intermittently connected clients, and up to 200,000 rule mutations per day.
- For this exercise, target 5 milliseconds p95 for a warm local decision and five minutes for 99 percent of online clients to receive an urgent published change.
- For this exercise, a client may be offline for 30 days and must recover without replaying an unbounded delta history.
- For this exercise, support 500,000 centrally served bootstrap or diagnostic reads per second during a broad client restart, while ordinary enforcement remains local.
- Every decision must identify the immutable policy version and normalized hostname used so false positives and stale-policy incidents can be reproduced.