Capacity Calculations and Infrastructure
Combined walkthrough of calculations and infrastructure.
Basic Assumptions
Backend API Server 8 vCPU 32 GB RAM Handles ≈ 400 RPS DB Server 4 vCPU 32 GB RAM 2 TB storage usable Cache Server (Redis) 8 vCPU 64 GB RAM usable cache ≈ 50 GB Storage Node 100 TB usable disk Rule: Always 2× redundancy minimum
TODO STANDARD SERVER ASSUMPTIONS Backend server handles = 400 RPS DB server storage = 2 TB = 2000 GB Cache server capacity = 50 GB Storage node capacity = 100 TB = 100000 GB BACKEND SERVERS Peak RPS = 800 Backend_servers = 800 / 400 = 2 Add redundancy = 4 servers DATABASE SERVERS Total storage = 220 GB DB_servers = 220 / 2000 = 0.11 ≈ 1 Add replica = 2 DB servers CACHE SERVERS Cache required = 2 GB Cache_servers = 2 / 50 = 0.04 ≈ 1 STORAGE NODES Storage required = 220 GB Storage_nodes = 220 / 100000 = 0.002 ≈ 1
CHAT STANDARD SERVER ASSUMPTIONS Backend server handles = 400 RPS DB server storage = 2000 GB Cache server capacity = 50 GB Storage node capacity = 100000 GB BACKEND SERVERS Peak RPS = 9300 Backend_servers = 9300 / 400 = 23.25 ≈ 24 Add redundancy ≈ 30 servers DATABASE SERVERS Total storage = 219 TB = 219000 GB DB_servers = 219000 / 2000 = 109.5 ≈ 110 Add replica ≈ 220 DB servers CACHE SERVERS Cache required = 30 GB Cache_servers = 30 / 50 = 0.6 ≈ 1 Add replica = 2 cache servers STORAGE NODES Storage required = 219000 GB Storage_nodes = 219000 / 100000 = 2.19 ≈ 3 Add redundancy = 6 storage nodes
URL SHORTNER STANDARD SERVER ASSUMPTIONS Backend server handles = 400 RPS DB server storage = 2000 GB Cache server capacity = 50 GB Storage node capacity = 100000 GB BACKEND SERVERS Peak RPS = 380 Backend_servers = 380 / 400 = 0.95 ≈ 1 Add redundancy = 3 servers DATABASE SERVERS Total storage = 1000 GB DB_servers = 1000 / 2000 = 0.5 ≈ 1 Add replica = 2 DB servers CACHE SERVERS Cache required = 2 GB Cache_servers = 2 / 50 = 0.04 ≈ 1 STORAGE NODES Storage required = 1000 GB Storage_nodes = 1000 / 100000 = 0.01 ≈ 1
NETFLIX STANDARD SERVER ASSUMPTIONS Backend server handles = 400 RPS Cache server capacity = 50 GB Storage node capacity = 100 TB = 100000 GB BACKEND SERVERS Peak RPS = 575 Backend_servers = 575 / 400 = 1.43 ≈ 2 Add redundancy ≈ 5 servers DATABASE SERVERS (metadata only) Metadata ≈ 100 GB DB servers = 3 (primary + replicas) CACHE SERVERS Cache required = 200 GB Cache_servers = 200 / 50 = 4 Add replica = 8 cache servers STORAGE NODES Total storage = 547 PB = 547000000 GB Storage_nodes = 547000000 / 100000 = 5470 nodes