Reddit
0-day streakReview

Your progress

Level 1

0 XP100 XP to level 2
0day streak
0best streak
0topics started
0cards reviewed
    Review cards

    Progress is stored only in this browser. No account is required.

    Design Reddit: the 60-second story

    Design Reddit

    Every Reddit page is a sorted list, and the votes never stop.

    Hot, new, top, best. 130 million daily users read them while votes keep reshuffling the order.

    90k/s

    sorted page reads at the daily peak

    130M daily users × 30 loads = 3.9B reads a day. Assume 300M votes a day too, 7,000 a second at peak.

    Where does the sorting happen?

    Bad: Sort on every read

    90k sorts a second over scores that keep changing.

    Good: Sort once per change

    Each community’s top 1,000 per sort lives in Redis. A page reads 25 IDs.

    Reddit’s hot score never looks at the clock

    Log of net votes plus submission time ÷ 45,000 s, so 12.5 hours of newness is worth 10× the votes. Rank moves only when a vote lands.

    100 → 1

    row writes a second for a viral post

    Your vote is one row keyed by user and item, shown at once. Workers sum each item’s votes per second, so totals lag seconds.

    A post hits a 40-million-member community. Copy it into 40 million feeds?

    The trick

    Members share one ranked list, so your feed merges the hot lists of up to 50 joined communities.

    One upvote, no downvotes. Why does it rank last?

    Net score favours early comments, and share lets one vote win. Rank by the Wilson lower bound of the upvote share, and 10 up, 1 down wins.

    200,000 fans on one match thread

    1. Logged out: the CDN caches each page 5 s
    2. Logged in: one shared body, cached 2 s
    3. One rebuild per server; the rest serve stale
    4. Overlay only your own votes

    Remember

    No request sorts or counts. A clock-free hot score lets workers keep listings sorted from batched votes. Comments rank by the Wilson bound, feeds merge shared lists, and viral threads come from cache.