Capacity estimation
Traffic Volume:
Let us assume the below numbers,
Total Users : 500 million
Daily Active Users (DAU): 50 million
Monthly Active Users (MAU): 330 million
Screen Views per Month: 21 billion
Visits in One Month: 1.6 billion
Total Subreddits: 2 million
Transaction Handling:
- Number of Transactions Per Second (TPS):
- Assuming a linear distribution of screen views and visits throughout the month, we can calculate the average TPS using the monthly values.
- Total Monthly TPS = Screen Views per Month + Visits in One Month
- Total Monthly TPS = 21 billion + 1.6 billion = 22.6 billion
- Average TPS = Total Monthly TPS / (30 days * 24 hours * 3600 seconds)
- Average TPS = 22.6 billion / (30 * 24 * 3600) ≈ 8,266 TPS
- Number of Write Requests Per Second for Posts:
- Given there are 2 million posts created in a day, we can calculate the number of new posts in a year.
- New Posts Per Year = 2 million * 365 days
- New Posts Per Year = 730 million
- Write Requests Per Second = New Posts Per Year / (365 days * 24 hours * 3600 seconds)
- Write Requests Per Second = 730 million / (365 * 24 * 3600) ≈ 23.14 TPS
- Number of Comment Requests Per Second:
- Assuming each post has an average of 25 comments, we can calculate the total comment requests per second.
- Total Comment Requests Per Second = New Posts Per Year * Average Comments Per Post / (365 days * 24 hours * 3600 seconds)
- Total Comment Requests Per Second = 730 million * 25 / (365 * 24 * 3600) ≈ 18.40 TPS
Storage Estimations (5 Years):
- User Data:
- Assuming user data includes basic profile information, authentication details, and activity logs.
- Let's estimate an average user data size of 1 MB.
- Total User Data Storage = Total Users * Average User Data Size
- Total User Data Storage = 500 million * 1 MB = 500 million MB
- Total User Data Storage = 500 TB
- Subreddit Metadata:
- Subreddit metadata includes information such as subreddit names, descriptions, and moderator lists.
- Assuming an average metadata size of 10 KB per subreddit.
- Total Subreddit Metadata Storage = Total Subreddits * Average Metadata Size
- Total Subreddit Metadata Storage = 2 million * 10 KB = 20 million KB
- Total Subreddit Metadata Storage = 20 GB
- Posts:
- Considering posts include text, links, and metadata, let's estimate an average post size of 100 KB.
- Assuming the number of new posts per year remains consistent.
- Total Post Storage Per Year = New Posts Per Year * Average Post Size
- Total Post Storage Per Year = 730 million * 100 KB = 73 PB
- Total Post Storage for 5 Years = Total Post Storage Per Year * 5
- Total Post Storage for 5 Years = 73 PB * 5 = 365 PB
- Comments:
- Similar to posts, let's estimate an average comment size of 10 KB.
- Total Comment Storage Per Year = New Posts Per Year * Average Comments Per Post * Average Comment Size
- Total Comment Storage Per Year = 730 million * 25 * 10 KB = 182.5 TB
- Total Comment Storage for 5 Years = Total Comment Storage Per Year * 5
- Total Comment Storage for 5 Years = 182.5 TB * 5 = 912.5 TB
These estimations provide a basis for understanding the storage requirements of the Reddit-like platform over a 5-year period, considering user data, subreddit metadata, posts, and comments.