Twitter is an online social networking service where users post and read short messages called “tweets”.
Most candidates try to design Twitter as a monolithic service in System Design Interview. If you check several existing online resources, they also try to design Twitter as a monolithic service. However, in our opinion, designing a gigantic service like Twitter as a monolithic service shows that the candidate lacks experience in designing distributed systems. Nowadays, it is a norm to design distributed systems in terms of microservices and even lamdas (or functions). No one is writing a new service as a monolithic service and companies are gradually converting their big monolithic services to a set of microservices. Hence, the candidates should discuss Twitter system design as a microservices architecture.
Here, we will discuss the high-level design of the Twitter service. The Twitter service comprises several micro-services as follows:
- Tweet Service
- User Timeline Service
- Fanout Service
- Home Timeline Service
- Social Graph Service
- Search Service
The following is the architecture of different logical components or micro-services in the Twitter service. Please note it is not an architecture of physical components. Also, we are not showing LB in front of each micro-service here for the sake of simplicity.
If you are interested to know more, you can checkout out the below videos where we are discussing the microservices architecture of Twitter in greater details:
For greater details on the microservices architecture system design of Twitter service, check the chapter on the Twitter System Design in Distributed System Design Interviews Bible.
This is a great resource to not just improve your distributed system design skills but also to ace your distributed system design interviews and targeting level L5+ in companies like Facebook, Google, etc. The book/course is still in-progress work. There are already quite a few chapters discussing the design of TinyURL, Twitter, Distributed Cache, Uber, Whatsapp, Netflix, Dropbox, etc. We will be adding more chapters soon.
The course also includes a section on mock system design interviews. This is a great resource because it will provide you the experience of an actual distributed system design interview. More mock system design interviews are being added as well.