Twitter System Design

Welcome to this blog. We shall learn about the system design of twitter.

Question:- Let’s first look at the twitter’s basic functionality first :-

  • HomeTimeline is the one, where user sees his/her friend’s tweets.

Question:- Now, let’s see the functional requirements :-

Question: -Nature of the twitter is not that sort of transactional type. It’s nature is like as mentioned below :-

Question:- Where do we keep the tweets, once created ?

  • User Table → Stores user information.

Question:- We also store following lists in Redis :-

  • <UserId, List_of_Tweets> → To be used for User Timeline.

Question:- How does UserTimeline is computed ?

Question:- How does HomeTimeline is computed ?

Question:- How does FanOut approach works ?

  • Say User U1 have 100 friends/followers.

Question:- Does FanOut approach works in case of Celebrity as well ?

No, it doesn’t works.

  • A Celebrity may have Millions of followers.

Question:- What does the trending items means ?

Question:- Based upon what factors, a tweet becomes the Trending Tweet ?

Question:- How does we process the trending tweets ?

Question:- How does the search functionality works with twitter ?

Question:- Whats the design of the Search database ?

It’s something similar to the ElasticSearch design, which consists of the multiple nodes n the cluster.

Question:- How does the overall system looks like ?

That’s all in this section. If you liked reading this blog, kindly do press on clap button multiple times, to indicate your appreciation. We would see you in next series.

--

--

Software Engineer for Big Data distributed systems

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store