Facebook Post Search System Design

Visual Problem Diagram

Facebook Post Search System Design architecture diagram

Scenario

User searches their timeline for "beach wedding 2019" across posts with photos, links, and privacy scopes—global search must never return friends-only posts to strangers. Per-user index shard + privacy filter on every query is the trap.

Design search over social posts (user posts, group posts) respecting visibility rules. Every result must pass authorization for the searching viewer—indexing shortcuts that leak private posts fail the interview.

You should support full-text search, filters, ranking, and incremental indexing. Be ready to explain ACL in the index and post-filter authorization.

Constraints

Functional

Index posts, search by keyword/filters, rank results, enforce visibility, delete/update index

Non-functional

< 300 ms p95 search, near-real-time index minutes, no privacy leaks, 99.9% availability

Scale

Billions posts, millions searches/day, heterogeneous visibility rules

Stages ahead

1Requirement Analysis
2API Design
3High-Level Design
4HLD Extensions
5Trade-offs