Twitter Architecture

What we will build as a MVP of Twitter?

System Characteristics

Architecture

Basic Architecture of Twitter service consists of a User Table, Tweet Table and Followers Table

Building User Timeline

Building Home Timeline

Optimization for Home Timeline

We can optimize home timeline by precomputing all the home timelines and storing it in-memory (e.g. Redis). A simple flow of tweet looks like,

Twitter Architecture

System Optimizations as User grows

Optimization for Celebrity Followers

If a person with 1 million followers on Twitter tweet, We need to update one million lists which is not very scalable. What we can do is,

References

System Design: How to design Twitter? Interview question at Facebook, Google, Microsoft
How to answer design question: How do you design a twitter?

SUBSCRIBE TO NEW CONTENT

Tutorials on System Design, BlockChain, Design Patterns and more sent out once a week.

Loading comments...