Comment system inspired by Disqus and Reddit threads: comments are read far more than written, hot threads are cached and served from the edge, and spam checks run in the background.
See why reading all comments from the database on every page view does not scale.
What was missing: A page should not read all its comments from the database on every view.
Why that's risky: A popular story has thousands of identical comment loads per second.
What gets added: One server that reads a page's comments from the database on every view and saves each comment.
Trade-offs: Always current, but slow under load.
Separate reading from posting and serve threads from memory.
What was missing: Reading and posting share one path.
Why that's risky: A new comment can take a moment to show in a cached thread.
What gets added: A read service serving threads from a cache keyed by page, a post service that saves comments and replies, and a comment database as source of truth.
Trade-offs: Threads are served from memory; a new comment is visible after the cache is updated or expires.
Serve the first page of hot threads from the edge.
What was missing: A breaking story sends everyone to the same thread.
Why that's risky: A cached first page hides a new comment for a few seconds.
What gets added: A CDN caches the first page of hot threads for a few seconds.
Trade-offs: A few seconds of delay is fine for a hot thread; deeper pages come from the cache.
Screen new comments in the background and limit abuse.
What was missing: Spam stays visible and anyone can flood threads.
Why that's risky: Screening inside the post request would make every comment wait for a spam check.
What gets added: A moderation queue with spam workers that screen each new comment, hide spam and refresh the thread, a rate limiter and monitoring.
Trade-offs: Comments appear immediately and spam is hidden within seconds, trading a short window of visibility for fast posting.
You're in the middle of an interview session. Leaving now will end your current attempt.
Explore concept overviews, real-system examples, key tradeoffs, and interview talking points for each roadmap section.
You've conquered this phase. These are the skills you now own: