Phase 2
Foundations
Networking, load balancing, caching, and scaling. The building blocks of every large system.
Pause & reflect
Before you read on, answer this in your head — or on paper:
A single server handles 1,000 req/s. You need 100,000 req/s.
What are your options? Add more servers — but how do you distribute traffic? What fails when one server dies?
IP Addresses
IP addresses uniquely identify devices on a network. IPv4 uses 32-bit dot-decimal notation (e.g. 102.22.192.181) — about 4 billion addresses. IPv6 uses 128-bit hex notation and provides far more addresses. Types: public (one per network, from ISP), private (per-device within a network), static (manually set, stable), dynamic (assigned by DHCP, can change).
OSI Model
Seven layers from top to bottom. Helps troubleshoot and reason about where failures happen:
- 7. Application — HTTP, SMTP. User-facing protocols.
- 6. Presentation — Translation, encryption, compression.
- 5. Session — Opens/closes connections, sync checkpoints.
- 4. Transport — TCP/UDP. Segments, end-to-end delivery.
- 3. Network — Packets, routing between networks.
- 2. Data Link — Frames, same-network transfer.
- 1. Physical — Cables, switches, bits.
TCP vs UDP
TCP: Connection-oriented, reliable, ordered. Retransmits lost packets. Slower. Use for HTTP, databases, SMTP. UDP: Connectionless, no guarantee. No retransmission. Faster. Use for video streaming, DNS, VoIP when latency matters more than loss. Broadcast supported in UDP only.
Domain Name System (DNS)
Maps domain names to IP addresses. Hierarchical lookup: Client → Resolver → Root → TLD (.com, .org) → Authoritative nameserver. Record types: A (IPv4), AAAA (IPv6), CNAME (alias), MX (mail), NS (nameserver), TXT. All have TTL (time-to-live) for caching. Reverse DNS uses PTR records (IP → name), often for email validation.
Proxy & Reverse Proxy
Forward proxy: Sits in front of clients. Hides client identity, can block/filter, allow geo-restricted access. Reverse proxy: Sits in front of origin servers. Hides server identity. Can cache, SSL terminate, load balance. A load balancer is often a reverse proxy; a reverse proxy can work with one server too.
Next
With networking and scaling under your belt, move to the data layer — databases, replication, sharding, and consistency.