Lesson 13 of 18
3. Client and Server

Memory card and where the analogy breaks

3 min read+10 XP

The memory card (tear this page out)

#QuestionMemory code
3.1Client and server?Customers ask, kitchens cook
3.2Request and response?One slip, one plate. Nothing is served that wasn't ordered.
3.3Typing a URL?Few Cooks Serve All And Smile: Find, Connect, Secure, Ask, Answer, Show
3.4HTTP methods?GET looks, POST adds, PUT replaces, PATCH tweaks, DELETE removes
3.5Status codes?2 is good, 3 go elsewhere, 4 your fault, 5 our fault
3.6Headers and body?Headers describe, body delivers
3.7TCP vs UDP?TCP confirms, UDP fires and forgets
3.8HTTPS?Check the badge, then seal the envelope
3.9Keep-alive, HTTP/2, HTTP/3?Keep the waiter, fill the tray, don't stop for one dropped plate
3.10Stateless?Every slip says it all
3.11Cookies, sessions, tokens?Session: we keep the notebook. Token: you carry the stamped card.

The whole chapter in one line: The customer always orders first, the slip says everything, and the envelope is sealed.

Where the analogy breaks

  • A waiter serves a few tables. A server handles thousands of requests at the same time, from people who never see each other.
  • A restaurant has one kitchen. A website usually has many identical servers behind a load balancer, which is exactly why statelessness matters.
  • Waiters don't need a handshake before every table. Networks do, and those round trips are a real cost you design around.

Quick check

Five questions on this chapter. Pick an answer, then check it.

quiz