Back of Envelope Calculations - Cheat Sheet
Back of Envelope Calculations - Cheat Sheet
Note: All the numbers in this post are heavily rounded as their purpose is to give a
rough guide for design decisions in the moment. You should always do more precise
calculations before starting on a project/feature.
Useful Calculations
x Million users * y KB = xy GB
example: 1M users * a documents of 100KB per day = 100GB per day.
x Million users * y MB = xy TB
example: 200M users * a short video of 2MB per day = 400TB per day.
Thousands = KB (3 zeros)
Millions = MB(6 zeros)
Billions = GB (9 zeros)
Trillions = TB (12 zeros)
Quadrilions = PB (15 zeros)
Byte Conversions
1B = 8bits
1KB = 1000B
1MB = 1000KB
1GB = 1000MB
Object Sizes
Data
The numbers vary depending on the language and implementation.
char: 1B (8 bits)
UUID/GUID: 16B
Objects
File: 100 KB
Picture: 200 KB
Long/Lat: 8B
Lengths
Maximum URL Size: ~2000 (depends on browser)
100 (number of millions) * 12 (the number per second for 1M) = 1200 uploads a
second.
The web servers will need to handle a network bandwidth of 240MB per second. You
will therefore need a machine with high network performance to handle this
bandwidth. In AWS this would translate to at least a m4.4xlarge, but it would be
better to have multiple smaller servers to handle fault tolerance.
Usage
Users
Facebook: 2.27B | YouTube: 2B | Instagram: 1B
TikTok: 3.7M
Visits
You can get a rough number of the visits a site gets at the similarweb website.
Cost of Operations
Read sequentially from HDD: 30 MB/s
Systems
These are not exact numbers, which very much depend on the implementation and
what is hosting the service. The purpose of the numbers is to have a general idea of
the performance across different types of services.
SQL Databases
Storage: 60TB
Connections: 30K
Storage: 300 GB
Connections: 10k
Queues/Streams
[Pub/Sub — limits][Kinesis — limits][SQS — limits]
Scrapers
[Colly — go scraper]