Menu

Earn Premium with Referrals

Invite your friends and earn Premium rewards through our referral program.

See how it works and start inviting friends.

Bandwidth Estimation
HLD

Bandwidth Estimation

Throughput times payload, both directions — sizing network pipes and spotting where egress costs live.

The Two Multipliers

Bandwidth = QPS × payload size. Every path has both directions, and they rarely match:

 INGRESS (into system)              EGRESS (out to users)
 client requests, uploads           responses, media, pages
 
 typically small for read apps      typically 5–50x ingress
                                    ← the number that shows up on invoices

Worked Example: RideShare

 RIDER READ PATH (egress-dominant):
   GET /trip/status response ≈ 2 KB × 900 peak rps  ≈ 1.8 MB/s egress
   
 LOCATION INGESTION (ingress-heavy — unusual!):
   ping ≈ 200 B × 100k/sec                          ≈ 20 MB/s ingress
   fan-out to nearby drivers' match views adds internal egress
   
 INTERNAL (server↔server):
   replica reads, cache fills, CDC streams — often exceeds
   user-facing traffic; cross-AZ transfer is PRICED per GB

The surprise pattern: a location service with modest user counts moves more bytes than its web tier — telemetry payloads are tiny but relentless.

Units Discipline

The classic estimation error lives here:

 network speaks BITS:    1 Gbps NIC = 125 MB/s  (÷8!)
 cloud links quoted in Gbps
 payloads measured in BYTES
 
 conversion slips cause order-of-magnitude errors → always divide by 8 first

What the Numbers Get Compared Against

LinkApprox capacityImplication
Cloud instance NIC (typical)1–25 GbpsPer-box ceiling before LB spreads load
Cross-AZ transferpriced ~$0.01–0.02/GBReplica placement is a cost decision
Internet egress~$0.05–0.12/GBCDN offload pays for itself fast

(Prices illustrative; orders of magnitude are the point.)

Example consequence: 20 MB/s sustained = ~52 TB/month. At internet egress rates that’s real money monthly; served from CDN edge it’s a fraction — the estimate just made an architecture argument.

Media Changes Everything

Text systems measure bandwidth in KB/s; media in TB/s:

 video platform sanity check (illustrative):
   100k concurrent viewers × 3 Mbps stream
   = 300k Mbps = 300 Gbps sustained egress
   → physically impossible from one origin region
   → CDN is not an optimization here; it is the architecture

This is why bandwidth estimation precedes component choice for any media-adjacent design.

Interview Framing

Run one direction of math per traffic class, convert bits/bytes correctly out loud, then land the implication (“that egress volume means CDN-first delivery” or “cross-AZ chatter argues for replica-aware reads”). Bandwidth numbers score when they terminate in a decision — a bare Gbps figure floating in the air scores nothing.

My Private Notes

Notes are auto-saved locally to this device.