StackGrab

Stage 4 · Recap

What stuck?

A few checks to make the ideas yours, then the next stop on the route.

What to remember

  • A page load is a chain of hops: the browser, the app server, the database and the static files or CDN.
  • Dynamic page time is the sum of network time, app work and database queries.
  • Static files are identical for every user, so caching them on a CDN shortens the trip without changing the page.
  • The N+1 pattern repeats one small query many times; a trace shows it as the slowest part.

Quick check

0 of 6 answered

All 6 questions are here so you can see the climb from recall to challenge. Answer them, then check. 4 of 6 passes; you can retry with new questions. No penalty for guessing.

  1. Warm-up
    1.In the shop analogy, which part is the stockroom that holds products and orders?
  2. Warm-up
    2.What does a CDN do for a web app?
  3. Apply
    3.Using the lab’s illustrative numbers: a round trip to the server is 120 ms, app work is 10 ms, and 21 database queries take 10 ms each. What is the dynamic page time?
  4. Apply
    4.Static files come from the server (120 ms round trip) instead of a CDN (20 ms). How much do you save on that hop?
  5. Challenge
    5.A page runs one query for a list of 20 items, then one query per item at 10 ms each. How much database time does that N+1 pattern add compared with a single query?
  6. Challenge
    6.A trace shows 210 ms in the database, 120 ms of network and 10 ms of app work. Which change helps most?
08

Next lesson

Measuring systems

Continue the journey →