Key-Value and Document Stores · بذر 1 · A۴، مناسب چاپ. پاسخ‌نامه در صفحه‌ای جدا برای بزرگ‌ترها چاپ می‌شود.
به انگلیسی

One key in, whole thing back

رایانش · داده‌ها و پایگاه‌های داده · سن ۲۰ تا ۲۱ سال
نام ______________________   تاریخ ____________
  1. A cat document is {"name": "Mittens", "age": 5}. In Python, what does cat["name"] give?

    • 5
    • name
    • Mittens
  2. 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
  3. A key-value store checks the shape of your data and joins tables for you.

    دور یکی دایره کشیدن:   درست   نادرست

  4. 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
  5. 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
  6. 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
  7. 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
  8. 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
LightMySky · lightmysky.comW1-mt_PfBDSgfeQX-s1

پاسخ‌نامه

برای بزرگ‌ترها. تا کردن این صفحه پیش از تحویل بقیه.

One key in, whole thing back W1-mt_PfBDSgfeQX-s1

  1. Mittens · You reach a value through its key, so the name key gives Mittens.
  2. The whole value stored under that key · One key in, whole value back, with no checks and no joins.
  3. نادرست · It does neither: it stores what you give and returns whole values by key.
  4. The average age of all cats in every city · Cross-cutting questions need joins and a schema, which documents gave up.
  5. Every copy must change, or copies disagree · Duplication charges work and risk on every update: miss a copy and data disagrees.
  6. Cat and owner are stored together in one place · Nesting keeps related values in one place, so a single lookup suffices.
  7. Duplication buys read speed but charges work and risk on every update · The trade is fixed: fast simple reads now, update toil and disagreement risk later.
  8. One document per post with nested comments, for fast single-thing reads · The workload reads one nested thing at a time, which is the document sweet spot.
کاربرگ · LightMySky