Part 03 · Revision sheet

Networking and API Design

Key Terms

  • OSI / TCP-IP model — TCP/IP's 4 layers (link, internet, transport, application) is what the internet runs on; OSI's 7 is shared vocabulary (→ 23)
  • IP address / routing — a host address plus hop-by-hop forwarding toward the destination network via longest-prefix match (→ 24)
  • TCP — connection-oriented, reliable, ordered, congestion-controlled transport (→ 25)
  • UDP — connectionless transport, no delivery or ordering guarantee, lower overhead (→ 25)
  • DNS — a distributed, hierarchical, cached lookup system resolving names to addresses (→ 26)
  • TLS — wraps a connection for confidentiality, integrity and server authentication via a CA-signed certificate (→ 27)
  • HTTP/1.1, HTTP/2, HTTP/3 — same semantics, differing transport: one request per connection; multiplexed over one TCP connection; multiplexed over QUIC/UDP (→ 28)
  • Reverse / forward proxy — reverse proxy acts for servers (TLS termination, routing); forward proxy acts for clients (egress control) (→ 29)
  • REST — resources identified by URIs, manipulated through standard HTTP methods, outcome carried in status codes (→ 31)
  • Idempotency key — a client-generated token letting the server return a stored outcome instead of repeating a retried mutation (→ 38)
  • API gateway — a reverse proxy plus authentication, rate limiting, routing/aggregation and protocol translation at one front door (→ 41)
  • Service discovery — how services find current healthy instances: client-side (caller queries the registry) vs. server-side (a fixed address queries it on the caller's behalf) (→ 42)

Decision Rules

  • Use TCP/IP's 4-layer model for day-to-day debugging; reach for OSI's 7 only as shared vocabulary (→ 23)
  • Default to TCP unless there's a measured reason not to; use UDP when low, consistent latency matters more than completeness and the application can tolerate loss (→ 25)
  • Always terminate TLS for traffic crossing a process boundary — the real decision is where, not whether (→ 27)
  • HTTP/1.1 with keep-alive suffices for low-traffic services; HTTP/2 is the sensible default; reach for HTTP/3 when a measured head-of-line or setup-latency cost is actually observed (→ 28)
  • Add a reverse proxy once more than one backend instance exists; add an API gateway once there is more than one backend service and more than one client type needing consistent cross-cutting policy (→ 29, 41)
  • Default to REST for a public API; use gRPC for internal service-to-service calls; use GraphQL only when the client-shape problem is real (→ 31, 32, 33)
  • Prefer additive, backward-compatible API changes first; reserve a version break, with a published deprecation window, for when a change truly cannot be additive (→ 35)
  • Use cursor pagination for large or write-heavy collections; use offset pagination for small, rarely-changing lists where users jump to arbitrary pages (→ 37)
  • Use an idempotency key for expensive, externally visible or financial mutations; a naturally idempotent operation needs none (→ 38)
  • Prefer server-side service discovery to keep discovery logic out of every caller; use static configuration or plain DNS when the fleet is small and stable (→ 42)

Numbers & Formulas

None — this part teaches no standalone numbers or formulas.

Traps

  • Treating OSI's 7 layers as literally implemented software, or diagnosing a symptom at the wrong layer (→ 23)
  • Assuming HTTP/2 "solves" head-of-line blocking — it only removes application-level queuing, not the TCP-level stall (→ 28)
  • Treating "authentication passed" as sufficient without a separate resource-level check — the most common real-world access-control bug (→ 39)
  • A webhook receiver that doesn't verify the sender's signature, or isn't idempotent, can be forged or double-processed (→ 40)
  • Letting business logic creep into API-gateway configuration instead of living inside a service (→ 41)

Self-Quiz

  1. Can you narrate the full "type a URL" request path and name which topic covers each stage? (no → revisit 30)
  2. Can you design a resource table for a small domain with no endpoint needing special-case client logic? (no → revisit 31)
  3. Can you classify a proposed schema change as backward-compatible, forward-compatible, full, or breaking? (no → revisit 34)
  4. Can you justify offset vs. cursor pagination for a given collection from its size and write pattern alone? (no → revisit 37)
  5. Can you implement the idempotency-key store-and-check pattern and explain a retry arriving mid-processing? (no → revisit 38)

Search the guide