HLDArena
HLD-333·Search & Indexing
Hard · 1,500 pts

Multi-Tenant Workspace Channel, Thread & ACL-Filtered Search

Design a Slack-scale enterprise chat search engine indexing millions of live messages, thread replies, and file snippets per minute while strictly intersecting query results with caller private-channel memberships and isolating mega-enterprise tenants.

Max p99
≤ 68 ms
Availability
≥ 99.6%
Budget
≤ $9,200

Functional Requirements

  • FR-1POST /v1/workspaces/{workspace_id}/messages/index — Indexes newly posted or edited channel/DM messages within < 3s search visibility.
  • FR-2GET /v1/workspaces/{workspace_id}/search — Executes BM25 + recency search strictly filtered to channels/DMs the caller can access.
  • FR-3DELETE /v1/workspaces/{workspace_id}/messages/{msg_id} — Honours message deletions and enterprise compliance retention purges across index segments.
  • FR-4Must prevent cross-tenant noisy neighbors (500k-seat workspace vs 50-seat startup) and sustain p99 <= 68 ms under 7x gray storage latency.

Workload Profile

Workday Messaging & Search50,000 Search Read RPS / 16,000 Real-Time Index Write RPS
Global Incident War-Room Peak132,000 Search Read RPS / 40,000 Message Index Write RPS
Active Working Set50 GB hot recent-30-day inverted segments & user channel-ACL bitsets
Tenant Isolation GateTiered shard routing per workspace_id + zero private-channel leakage

Consistency Model

Immediate compliance tombstoning on deleted messages/revoked channel membership; near-real-time (< 3s) new message segment refresh.

Relevant practice for

Click an item in Inventory above, or press B to add a component, double-click to name, C to connect.

Design Write-up

Write under ### Architecture for Diagram to take that up directly

Compulsory section · if not written yet, Diagram reads from the start of your write-up.
Architecture: required·FRs mentioned: 0/4·0 boxes · 0 edges
0 words
Hidden Cases #4–#7 run automatically on Submit
Case 1: Smoke & API ContractInput Workload
Read RPS
2,000 rps
Write RPS
400 rps
Key Distribution
Uniform (Low Skew)
Chaos Fault
None (Healthy Cluster)
Expected Pass CriteriaASSERTIONS
• Tail Latency: p99 ≤ 136 ms
• Availability: ≥ 99.6%
Valid end-to-end Client → Compute → Storage topology