Card 11/ 11

RecapDifficulty: Intermediate1 min

Recap: Building Blocks of a Web System

Six parts by job, the path of one request, and the two failures.

  • Six parts, six jobs: DNS resolves, a CDN serves nearby, a load balancer spreads, application servers compute, a cache remembers, a database keeps (The Building Blocks of a Web System).
  • DNS answers are cached for their TTL, so a change reaches readers only as old answers expire (DNS: Turning a Domain Name Into an Address).
  • A CDN serves static files from edge servers near each reader (CDNs: Serving Files From Near the Reader).
  • Stateless servers keep user state in a shared store, so any server can answer any request (Stateless Application Servers).
  • The database holds the original, which is why it gets the backups and the replicas (Databases: Where State Lives).
  • One request passes DNS, load balancer, server, cache, database, and back; distance to the reader dominates its time (Following One Request From Browser to Database).
  • Relational for rows that change together, NoSQL for records read whole by key at high volume (SQL vs NoSQL).
  • N+1 is one query per row of a list; fetch the related rows in one query (The N+1 Query Problem).
  • A part with no spare takes the whole system down with it (Single Points of Failure).