Scale calculations
To design a scalable Twitter-like service, it is essential to estimate the storage, bandwidth, and processing requirements based on the expected user base and usage patterns. These calculations help in making informed decisions about the infrastructure and resources needed to support the service. Let’s perform some scale calculations:
- Assumptions:
- Total number of users: 100 million
- Daily active users: 20 million
- Average number of tweets per user per day: 5
- Average tweet size: 200 bytes
- Average media size per tweet: 1 MB
- Percentage of tweets with media: 20%
- Retention period for tweets: Five years
- Storage requirements:
- Tweet storage:
- Daily tweet storage:
20 million users × 5 tweets/user/day × 200 bytes/tweet =
20 GB/day
- Yearly tweet storage:
20 GB/day × 365 days =
7.3 TB/year
- Total tweet storage for five years:
7.3 TB/year × 5 years =
36.5 TB
- Daily tweet storage:
- Tweet storage:
- Media storage:
- Daily media storage:
20 million users × 5 tweets/user/day × 20% media...
- Daily media storage: