System Design

Self-Hosted:

0.005 per GB for HDD/SAS. 0.05 per GB for SSD.

Cloud: 0.01 per GB/Month for HDD/SAS. 0.10 per GB/Month for SSD.

Back of the Envelope Numbers

OperationLatencyThroughput1 MiB1 GiB
Sequential Memory R/W (64 bytes)0.5 ns
— Single Thread, No SIMD10 GiB/s100 μs100 ms
— Single Thread, SIMD20 GiB/s50 μs50 ms
— Threaded, No SIMD30 GiB/s35 μs35 ms
— Threaded, SIMD35 GiB/s30 μs30 ms
Hashing, not crypto-safe (64 bytes)25 ns2 GiB/s500 μs500 ms
Random Memory R/W (64 bytes)50 ns1 GiB/s1 ms1s
Fast Serialization [8] [9]N/A1 GiB/s1 ms1s
Fast Deserialization [8] [9]N/A1 GiB/s1 ms1s
System Call500 nsN/AN/AN/A
Hashing, crypto-safe (64 bytes)500 ns200 MiB/s10 ms10s
Sequential SSD read (8 KiB)1 μs4 GiB/s200 μs200 ms
Context Switch [1] [2]10 μsN/AN/AN/A
Sequential SSD write, -fsync (8KiB)10 μs1 GiB/s1 ms1s
TCP Echo Server (32 KiB)10 μs4 GiB/s200 μs200 ms
Decompression [11]N/A1 GiB/s1 ms1s
Compression [11]N/A500 MiB/s2 ms2s
Sequential SSD write, +fsync (8KiB)1 ms10 MiB/s100 ms2 min
Sorting (64-bit integers)N/A200 MiB/s5 ms5s
Random SSD Seek (8 KiB)100 μs70 MiB/s15 ms15s
Serialization [8] [9]N/A100 MiB/s10 ms10s
Deserialization [8] [9]N/A100 MiB/s10 ms10s
Proxy: Envoy/ProxySQL/Nginx/HAProxy50 μs???
Network within same region [6]250 μs100 MiB/s10 ms10s
{MySQL, Memcached, Redis, ..} Query500 μs???
Random HDD Seek (8 KiB)10 ms0.7 MiB/s2 s30m
Network between regions [6]Varies25 MiB/s40 ms40s
Network NA East > West60 ms25 MiB/s40 ms40s
Network EU West > NA East80 ms25 MiB/s40 ms40s
Network NA West > Singapore180 ms25 MiB/s40 ms40s
Network EU West > Singapore160 ms25 MiB/s40 ms40s

Costs

WhatAmount$ / Month$ / Hour
CPU1$10$0.02
Memory1 GB$1
SSD1 GB$0.1
Disk1 GB$0.01
S3, GCS, ..1 GB$0.01
Network1 GB$0.01

Compression

WhatCompression Ratio
HTML2-3x
English2-4x
Source Code2-4x
Executables2-3x
RPC5-10x
SSL-2% [10]