A cat document is {"name": "Mittens", "age": 5}. In Python, what does cat["name"] give?
You hand a key-value store one key. What comes back?
- The whole value stored under that key
- A join of several tables
- Only the fields that match your filter
A key-value store checks the shape of your data and joins tables for you.
Circle one: True False
Which question does a document design answer badly?
- Show one post with all its comments
- The average age of all cats in every city
- Fetch one user profile by its key in a single lookup
Every cat record repeats its owner city, and the owner moves. What must happen?
- Every copy must change, or copies disagree
- Nothing, the store keeps copies in sync by itself
- Only one copy needs the new city
A cat record holds a nested owner object with name and city. Why is the read fast?
- The database joins the cat and owner tables quickly
- The city is stored on a faster disk
- Cat and owner are stored together in one place
A friend stores the city in every record for speed, then says updates are free too. What is the flaw?
- Duplication buys read speed but charges work and risk on every update
- Reads become slower with duplication
- Cities can never be stored in records
Readers open one blog post with its comments at a time. Which design fits, and why?
- Separate post and comment tables, joined on every read
- One document per post with nested comments, for fast single-thing reads
- One key per comment, fetched one at a time