Requirements for Twitter

Understand the requirements and estimation for Twitter's design.

Functional requirements

The following are the functional requirements of Twitter:

  • Post Tweets: Registered users can post one or more tweets on Twitter.

  • Delete Tweets: Registered users can delete one or more of their tweets on Twitter.

  • Like/dislike Tweets: Registered users can like/dislike public and their own tweets on Twitter.

  • Reply to Tweets: Registered users can reply to the public tweets on Twitter.

  • Search Tweets: Registered users can search tweets by typing keywords/hashtags/usernames in the search bar on Twitter.

  • View user/home timelines: Registered users can view the user’s timeline, which contains their own tweets. They can also view the home’s timeline, which contains followers’ tweets on Twitter.

  • Follow/unfollow the account: Registered users can follow/unfollow other users on Twitter.

  • Retweet a Tweet: Registered users can retweet public tweets of other users on Twitter.

Non-functional requirements

  • Availability: Many people and organizations use Twitter to communicate time-sensitive information (service outage messages). Therefore, our service must be highly available, requiring a good uptime percentage.

  • Latency: Latency to show the most recent top Tweets in the home timeline could be a little high. However, near real-time services such as Tweet distribution to followers must have low latency.

  • Scalability: The workload on Twitter is read-heavy, where we have many readers and relatively few writers, which eventually requires the scalability of computational resources. Some estimates suggest a 1:1000 write to read ratio for Twitter. Although the Tweet is limited to 280 characters, and the video clip is limited to 140s by default, we need high storage capacity to store and deliver Tweets posted by public figures to their millions of followers.

  • Reliability: All Tweets remain on Twitter means Twitter never deletes its content. So, there should be a promising strategy to prevent the loss or damage of the uploaded content.

  • Consistency: There is a possibility that the user on the east coast of the USA does not get an immediate status (like, reply, etc.) update on the Tweet, which is liked or retweeted by the user on the west coast of the USA. But the user on the west coast of the USA needs an immediate status update on his like or reply. An effective technique is needed to offer rapid feedback to the user (who liked someone’s post), then to other specified users in the same region, and finally to all worldwide users linked to the Tweet.

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy