Back to Case Studies

Design Twitter

Overview--

The system allows users to create, edit, delete, like, retweet, and reply to tweets. Users can follow other users and see their tweets on a personalized Timeline (Home Feed). It also supports tweet search and user profile management.



Functional Requirements--


  • User should be able to create, edit, and delete tweets.

  • Users should be able to like, retweet, and reply to tweets.

  • Users should be able to search for tweets.

  • Users should be able to view tweets from users they follow on their homepage.

  • Users should be able to create an account and log in.

  • Users should be able to follow other users.



Non-Functional Requirements—


  • High Throughput: Capable of handling thousands of tweets, replies, and timeline requests per second

  • Low Latency: Timeline and tweet loading should be fast (target < 200ms)

  • Scalability: Horizontal scaling to support millions of users and growing traffic

  • High Availability: 99.9%+ uptime (system should remain available even if some services fail)

  • Fault Tolerance: Graceful handling of service or database failures

  • Eventual Consistency: Acceptable for timeline feeds (latest tweets may have slight delay)

  • Data Durability: No loss of tweets, replies, or user data

  • Rate Limiting: Prevent abuse and control traffic from individual users

  • Security: Strong authentication, authorization, SSL/TLS, and data privacy

  • Performance: Efficient read-heavy (timeline) and write operations





High-Level Design—




© 2026 Mehraj Hosen. All rights reserved.