Nested comment threads

DesignMedium35 min

Your task

Design a comment + threading system for a news/discussion site with ~10M daily readers. Threads can nest arbitrarily deep, popular articles get 50K+ comments, and the read:write ratio is roughly 100:1. Requirements: load a comment thread fast (top-level + a few replies each), 'load more replies' pagination, sort by top/newest, soft-delete that keeps replies visible, and live updates as new comments arrive. Most reads hit a small set of hot articles.

It covers

  • Comments
  • Threading
  • Tree storage
  • Pagination