Capacity Estimation
Given:
- DAU = 500 M users
- MAU = 2 B users
A. Throughput [requests per unit of time]
Now you start thinking:
Throughput can be further divided into write-throughput and read-throughput.
So, Let's start with what all operations user can perform:
- Create a Post [Write Operation]
- Follow/unfollow [Write Operation]
- Like/Comment [Write Operation]
- Instagram Feed [Read Operation]
A.1: Read-Throughput
Assume every user scrolling the feed sees an average of 100 post per day.
Total Read operations per day = DAU * 100 = 500 M * 100 = 50 B read-request per day.
A.2 Write-Throughput
Assume creating a post constitute a major chunk of write operations, neglecting others. And also 10% of users posts a post everyday.
Total Write operations per day = 10% of DAU = 0.1 * 500 M = 50M write requests per day
B. Storage [Bytes per unit of time]
The major storage will come from post becuase it will contain media. Assume a post consists of the following media alone with % of users posting it daily.
| Media-type | Media-size(Mb) | % |
|---|---|---|
| Text | 0.1 | 20 |
| Image | 0.5 | 60 |
| Video | 20 | 20 |
Average Post-Size = 0.1 * 0.2 + 0.5 * 0.6 + 20*0.2 Mb = 4.32 Mb
Total Storage per day = 10% of DAU * Average Post-Size
= 50M * 4.32 Mb
= 216 M Mb
= 216 Tb per day
Storage for 10 years = 216 Tb * 365 * 10
= 788400 Tb
= 788.4 Pb
C. Cache-Memory
Cache Memory is generally 1% of total storage per day
Cache-Memory = 1% of daily Storage = 0.01 * 216 Tb = 2.16Tb per day
D. Network Bandwidth
D.1: Ingress Traffic
Traffic coming into the system i.e. write traffic
Ingress = Write per second
= (Total Writing requests per second) * (Average Post size)
= (50M / 24/ 60/ 60) * (4.32 Mb)
= (0.57 K/sec) * (4.32 Mb)
= 2.5 Gbps
D.2: Egress Traffic
Traffic going out of the system i.e. read traffic
Egress = read per second
= (Total read requests per second) * (Average Post size)
= (50B / 24/ 60/ 60) * (4.32 Mb)
= (0.57 M/sec) * (4.32 Mb)
= 2.5 Tbps