Reddit 00:00:01 A community page and one person's vote A reader opens a forum sorted by Hot. Design a Reddit-style community feed that can share the ranked post list while still showing this reader's own vote on each post. A person opens a community in Hot order. Hot joins votes and time. Redis returns 25 IDs from the sorted list. IDs are small and shared by every reader. Recent choices are in Redis, older ones in the votes database. One batch by user. The client draws it and prefetches the next page when the person comes near the end. Fetching shared identifiers and private per-user state separately reduces duplication. The final page must also apply deletion and access rules current for this viewer. 00:00:46 One reader changes an upvote An optimistic interface can color the arrow immediately, but the durable vote needs an identity. Treat the pair consisting of user and post as the unit whose state changes. The arrow changes at once. This is optimistic: the client will undo it if the save fails. User and item name one row. The old choice is 0. The row change goes to Kafka with old, new and version, in the item's partition. Another consumer groups changes by author once a minute. It is not on the request path. An upvote changed to a downvote changes the aggregate by two. Include the old choice, new choice and event version so delayed or repeated updates cannot drift the total. 00:01:28 Insert one reply without rewriting a tree A popular discussion already has ten thousand comments. A new reply needs a parent, a thread and an identity, not a rewrite of every ancestor on the read path. The client sends the body and parent: the post or another comment. The row goes to the post's partition with its parent ID. No ancestor changes. Kafka receives the new row. Readers keep the old copy until the new visible tree is ready. Store the reply first, then update a read-optimized view. Readers can keep a coherent older tree while the replacement is built, subject to current access and removal checks. 00:02:04 Return a thread people can actually open A deep discussion is too large to send in one request. Bound the number of comments and nesting depth, choose which branches to expand and hydrate the bodies that matter. The request asks for Best, 200 comments and ten levels. The service groups rows by parent. Only those four bodies are read. A deleted parent would show a marker. The client draws branches that can collapse. A deleted parent may still need a visible structural placeholder so its surviving children remain reachable. Thread structure and the right to show a body are different decisions. 00:02:37 A viral post makes the total hot One post receives thousands of votes a second. Distinct user votes can be stored independently, while a single synchronously updated counter or ranking row becomes a point of contention. The edge and Redis serve its card. Each service keeps it for a second or two. 10,000 rows a second have different users, so they spread over partitions. The stream groups them before one update. People see a rounded count such as 50.2K. The order follows in about a second. Batch commutative aggregate deltas or partition counters, then reconcile against authoritative votes. Tell the product which visible totals may lag while each person's confirmed vote remains correct.