Partitioning and Replication for Scale · seed 1 · A4, ink-friendly. The answer key prints on its own page for grown-ups.

Splitting data across machines

Computing · Data & Databases · ages 21-22
Name ______________________   Date ____________
  1. What does synchronous replication promise a later reader?

    • The reader sees the write, because copies were confirmed
    • The reader sees older data for speed
    • The writer never waits for copies
  2. What is a partition key?

    • The password for a database node
    • The backup copy of a table
    • The value that decides which node holds each row
  3. Asynchronous replication always shows every reader the newest value.

    Circle one:   True   False

  4. One seller holds half of all rows. What will you see?

    • Every partition runs slightly warm
    • Reads get faster everywhere
    • One hot partition while others idle
  5. An orders table is keyed by customer. Which query turns slow?

    • One customer's orders
    • All orders placed last week
    • One customer's latest order
  6. A write returns, and a replica read one second later shows the old value. What explains it?

    • The partition key was chosen badly
    • The copies update asynchronously and lag behind
    • The write was never sent
  7. A shop tolerates slightly stale reads but fears one slow node blocking every sale. Which pairing fits?

    • Key by a rare query with synchronous copies
    • Keep no copies at all for maximum speed
    • Key by buyer with asynchronous copies
  8. A team keys its orders table by order date yet mostly looks up single customers. What is the mistake?

    • The key serves rare reports while punishing daily lookups
    • Dates cannot be used as keys
    • Customer lookups need no key at all
LightMySky · lightmysky.comW1-mt_Xvzz5Hnuvu-s1

Answer key

For grown-ups. Fold this page away before handing over the rest.

Splitting data across machines W1-mt_Xvzz5Hnuvu-s1

  1. The reader sees the write, because copies were confirmed · The write waited for its copies, so the new value is there.
  2. The value that decides which node holds each row · The key maps each row to its home partition.
  3. False · Async returns before copies catch up, so a fast read can be stale.
  4. One hot partition while others idle · Skew piles traffic on one node, which runs hot.
  5. All orders placed last week · The weekly report spans every key, so it must gather from all partitions.
  6. The copies update asynchronously and lag behind · Async copies lag, so a fast read sees the older value.
  7. Key by buyer with asynchronous copies · The buyer key speeds daily lookups and async writes never wait on a slow copy.
  8. The key serves rare reports while punishing daily lookups · The key should serve the most common query, not the rare one.
Worksheet · LightMySky