The journey of one request
Every arrow costs at least half a round trip. On mobile networks in India, a round trip can be 50–150 ms, so the number of round trips often matters more than server speed. Most web performance work is really round-trip reduction: CDNs move the server closer, connection reuse skips handshakes, and HTTP/2+ sends many requests over one connection.
The layers that matter
TCP, UDP and QUIC
| TCP | UDP | QUIC (HTTP/3) | |
|---|---|---|---|
| Delivery | Reliable, retransmits lost packets | Best effort | Reliable per stream |
| Ordering | Strict, for the whole connection | None | Per stream, so one loss doesn't block others |
| Setup | 1 RTT + TLS (1–2 RTT) | 0 RTT | 1 RTT including TLS, 0-RTT on resume |
| Typical use | Web, APIs, databases | DNS, video calls, games, telemetry | Modern web, mobile apps |
| Network switch (Wi-Fi → 4G) | Connection breaks | N/A | Survives (connection IDs) |
Head-of-line blocking is the key concept: with TCP, if packet 5 is lost, packets 6–20 wait even if they belong to unrelated requests. QUIC fixes this by giving each stream its own ordering.
TCP is a single-lane road: if one truck breaks down, everyone behind it waits. QUIC is a multi-lane road where each lane has its own traffic.
DNS: the internet's address book
DNS resolves names in a hierarchy: your device asks a recursive resolver (ISP, 1.1.1.1, 8.8.8.8), which asks the root, then the TLD servers (.in), then the domain's authoritative servers. Results are cached at every level for the record's TTL.
Things designers use DNS for:
- Geo-routing: return the IP of the nearest region.
- Weighted routing: send 5% of traffic to a new region.
- Failover: health-checked records stop returning a dead region's IP.
Thinking DNS failover is instant. Resolvers and devices cache records, sometimes ignoring short TTLs. Expect minutes, not seconds. For fast failover, use anycast IPs or a global load balancer that keeps one IP and reroutes behind it.