In this chapter, you are asked to design a news feed system. What is news feed? According to the Facebook help page, “News feed is the constantly updating list of stories in…
- 11.01Design a news feed systemIn this chapter, you are asked to design a news feed system. What is news feed? According to the Facebook help page, “News feed is the constantly updating list of stories in…
- 11.02Step 1 - Understand the problem and establish design scopeThe first set of clarification questions are to understand what the interviewer has in mind when she asks you to design a news feed system. At the very least, you should figure…
- 11.03Step 2 - Propose high-level design and get buy-inThe design is divided into two flows: feed publishing and news feed building. Feed publishing: when a user publishes a post, corresponding data is written into cache and…
- 11.04Newsfeed APIsThe news feed APIs are the primary ways for clients to communicate with servers. Those APIs are HTTP based that allow clients to perform actions, which include posting a…
- 11.05Feed publishingFigure 11-2 shows the high-level design of the feed publishing flow. User: a user can view news feeds on a browser or mobile app. A user makes a post with content “Hello”…
- 11.06Newsfeed buildingIn this section, we discuss how news feed is built behind the scenes. Figure 11-3 shows the high-level design: User: a user sends a request to retrieve her news feed. The…
- 11.07Step 3 - Design deep diveThe high-level design briefly covered two flows: feed publishing and news feed building. Here, we discuss those topics in more depth.
- 11.08Feed publishing deep diveFigure 11-4 outlines the detailed design for feed publishing. We have discussed most of components in high-level design, and we will focus on two components: web servers and…
- 11.09Newsfeed retrieval deep diveFigure 11-7 illustrates the detailed design for news feed retrieval. As shown in Figure 11-7, media content (images, videos, etc.) are stored in CDN for fast retrieval. Let us…
- 11.10Cache architectureCache is extremely important for a news feed system. We divide the cache tier into 5 layers as shown in Figure 11-8. News Feed: It stores IDs of news feeds.Content: It stores…
- 11.11Step 4 - Wrap upIn this chapter, we designed a news feed system. Our design contains two flows: feed publishing and news feed retrieval. Like any system design interview questions, there is no…
References
Step 4 - Wrap up
- How News Feed Works: https://www.facebook.com/help/327131014036297/
- Friend of Friend recommendations Neo4j and SQL Sever: http://geekswithblogs.net/brendonpage/archive/2015/10/26/friend-of-friendrecommendations-with-neo4j.aspx