Choose a store for six access patterns

short · 35 min · Objective 1.6

Task

Given six described access patterns, choose the store shape for each and state what would go wrong with the most tempting alternative. Choosing by access pattern rather than by familiarity is the whole skill in this objective.

Steps

  1. Write six access patterns into lab/stores.md: a shopping basket keyed by session; an order ledger where a half-completed transaction is unacceptable; a product catalogue with varying attributes per item; a year of per-second sensor readings; a recommendation engine traversing relationships; and a quarterly report aggregating a billion rows.
  2. For each, record the store shape in lab/stores.csv with columns pattern,store_shape,consistency_needed,why,tempting_wrong_answer.
  3. For the ledger, state explicitly whether eventual consistency is acceptable and what the business consequence of a stale read would be.
  4. For the quarterly report, explain why running it against the transactional database is the wrong answer and name the two options that are better.
  5. Mark any pattern where a cache would change the answer, and say what invalidates the cache.

Verify

awk -F, 'NR>1 && NF>=5 {n++} END {print n" pattern(s)"}' lab/stores.csv
awk -F, 'NR>1 {print $2}' lab/stores.csv | sort -u | wc -l
grep -Eci 'acid|transaction' lab/stores.csv
grep -Eci 'read replica|warehouse|olap' lab/stores.csv

Six patterns and at least four distinct store shapes. If one shape answers everything, the exercise was answered from habit.

This is an independent study companion for CompTIA Cloud+ CV0-004 and is not produced by or endorsed by CompTIA.