πKey Takeaways
- 1The client-server model is the foundation of all web architecture
- 2DNS resolves domain names to IP addresses; HTTP is the communication protocol
- 3HTTP/2 adds multiplexing and header compression; HTTP/3 uses QUIC over UDP
- 4WebSockets enable persistent bidirectional communication for real-time features
How the Web Works
Every interaction on the internet follows the client-server model: a client (browser, mobile app) sends a request to a server, and the server processes it and sends back a response. Understanding this flow β DNS, TCP, TLS, HTTP β is the bedrock of system design.
DNS Lookup
Browser checks local cache β OS cache β Router cache β ISP DNS resolver β Root DNS β TLD DNS (.com) β Authoritative DNS. Returns IP address (e.g., 142.250.80.46).
DNS uses UDP on port 53. Typical time: 20-120ms for a cache miss.
HTTP Versions Compared
| Feature | HTTP/1.1 | HTTP/2 | HTTP/3 |
|---|---|---|---|
| Transport | TCP | TCP | QUIC (UDP) |
| Multiplexing | No (one req per conn) | Yes (streams) | Yes (streams) |
| Head-of-line blocking | Yes | At TCP level | No |
| Header compression | No | HPACK | QPACK |
| Server push | No | Yes | Yes |
| Connection setup | 1 RTT + 1 RTT (TLS) | 1 RTT + 1 RTT (TLS) | 1 RTT (or 0-RTT) |
Real-Time Communication
Persistent bidirectional connection. Client sends HTTP Upgrade request, server responds with 101 Switching Protocols. After that, both sides can send messages at any time.
Use cases: chat, live sports scores, collaborative editing, trading platforms.
Downsides: stateful connection complicates load balancing; need sticky sessions or shared state.
Advantages
- β’Foundation of all web architecture
- β’Well-understood and standardized protocols
- β’HTTP/3 dramatically improves performance
Disadvantages
- β’WebSocket state complicates scaling
- β’TLS adds latency to new connections
- β’DNS can be a bottleneck if cache misses
π§ͺ Test Your Understanding
What protocol does HTTP/3 use as its transport layer?