Design Twitter

39 / 47

Design Twitter

Design Twitter

Write a full system design document for a Twitter-like platform covering scalability, caching, databases, and API design.

## What You'll Learn

• A full system design document for a Twitter-like platform covering scalability

• Caching

• Databases

• API design

## Tips

• Start with requirements: 500M users, 300K tweets/sec, 99.99% uptime

• Architecture: CDN → API Gateway → microservices → databases

• Bottlenecks: DB writes (sharding), timeline reads (caching), scale explosives

Requirements & Scale

Define the functional and non-functional requirements. Estimate the scale: how many users, tweets per second, reads vs writes?

0 / 150 characters(150 more required)

High-Level Architecture

Describe the major components and how they communicate. Include the client, API gateway, core services, and storage layers.

0 / 200 characters(200 more required)

Database Design

Choose and justify your storage strategy. What schema or data model do you use for tweets, users, and follows?

0 / 150 characters(150 more required)

Timeline / Feed Generation

How do you generate a user's home timeline? Compare fan-out-on-write vs fan-out-on-read and choose one with justification.

0 / 200 characters(200 more required)

Caching Strategy

Where and what do you cache? Describe cache eviction policies and how you handle cache invalidation.

0 / 120 characters(120 more required)

Scalability & Bottlenecks

Identify the top bottlenecks and explain how you address them (sharding, replication, rate limiting, etc.).

0 / 150 characters(150 more required)

Progress

0of 6 sections

Sections