FreeExam
A closed notebook, a blank card, and a pencil on a wooden desk.

Data system design

50 cards

Pipelines, storage, and serving paths that stay correct when a job is late or rerun.

Card 1 of 50

Front. Oltp-olap. Why not run analytics on the production database?

These cards are original study material. They are not questions from a named employer or a live hiring loop.

All 50 cards in this deck

  1. 1.Oltp-olap

    Why not run analytics on the production database?

    A large scan competes with the writes users are waiting on. Copy the data out and scan the copy.

  2. 2.Lambda

    What is a lambda architecture?

    A batch path that recomputes history and a stream path that covers the recent gap. You keep two implementations of the same metric.

  3. 3.Kappa

    What is a kappa architecture?

    One stream path, and you reprocess history by replaying the log. There is no second batch codebase to drift.

  4. 4.Lake

    What is a data lake?

    Files in object storage, kept in open formats, that many jobs can read. Without a table format and owners, it becomes a pile of unreadable files.

  5. 5.Serving

    What is a serving layer?

    The store a product reads for a low-latency lookup, filled by the pipeline. It is not the warehouse the analyst scans.

  6. 6.Lineage

    What is lineage?

    Which sources and jobs produced a table. It is how you find everything a broken upstream touches.

  7. 7.Quality

    What is a data quality check?

    A test on freshness, volume, nulls, or an accepted range, run before the table is marked ready for readers.

  8. 8.Contract

    What does a producer contract protect?

    The downstream jobs. A renamed field fails the contract at the producer, instead of zeroing a metric tomorrow.

  9. 9.Backfill-plan

    What belongs in a backfill plan?

    The range, the expected row change, and how readers are kept on the old snapshot until the new one is checked.

  10. 10.Idem-job

    How do you make a daily job safe to rerun?

    The partition is overwritten, or the write is a merge on a key. An append-only rerun duplicates the day.

  11. 11.Orchestrate

    What does an orchestrator do?

    It runs jobs in dependency order, retries a failure, and records which run produced which output.

  12. 12.Sensor

    What is a sensor in a pipeline?

    A wait for something upstream to exist, such as a partition. A sensor with no timeout waits forever and looks like a running job.

  13. 13.Sla

    What is a pipeline SLA?

    The time by which a table must be ready. The alert fires on the lateness, not only on a task that threw an exception.

  14. 14.Small-files

    How do you keep a streaming table readable?

    Compact files on a cadence, and do not commit a file per event. Readers pay for every file they open.

  15. 15.Schema-on

    What is schema-on-read?

    The files have no enforced schema. Each reader interprets the bytes. One job's assumption can disagree with another's.

  16. 16.Schema-write

    What is schema-on-write?

    The table rejects a write that does not match. Producers find out immediately. Readers can trust the columns.

  17. 17.Pii-zone

    How do you design access for sensitive columns?

    Put them in a separate location or policy, and give the wide analyst table a token or nothing. Copying them into every mart spreads the risk.

  18. 18.Time-travel

    What is time travel on a table?

    Reading a snapshot from earlier. It is how you compare a bad load with the previous good one, and how you restore.

  19. 19.Cdc-design

    Where does change data capture sit?

    Close to the source database, writing an append-only log. The warehouse applies that log. The source is not queried for diffs.

  20. 20.Exactly-effect

    How do you get a once-only effect?

    Store the source key with the row, and make the write a merge. Reprocessing then replaces the row instead of adding another.

  21. 21.Clock-skew

    How do you handle events from many clocks?

    Carry event time and arrival time. Define the window on event time, and decide how late an event may be and still count.

  22. 22.Multi-hop

    Why keep a staging table?

    So the raw payload, the cleaned row, and the mart can change at different speeds. Skipping straight to the mart makes a replay expensive.

  23. 23.Fan-in

    What is fan-in?

    Several sources landing in one table. Each source needs a key namespace, or their ids will collide.

  24. 24.Fan-out-d

    What is fan-out from a cleaned table?

    Several marts read one cleaned table. A fix in that table reaches every mart on the next build. Logic copied into each mart has to be fixed once for every mart.

  25. 25.Cost

    What drives warehouse cost in a design?

    Bytes scanned, how often, and how long the engine is on. Partitioning and a schedule cut more spend than a larger engine.

  26. 26.Fresh-vs-cost

    What is the freshness and cost tradeoff?

    A tighter freshness reruns more often and scans more. Name the decision the fresher number changes, or keep the cheaper schedule.

  27. 27.Quarantine

    Where do bad rows go in the design?

    A side table with the reason, while the published table contains only rows that passed. Dropping them on the floor hides the source bug.

  28. 28.Publish

    What does publishing a table mean?

    Swapping the ready snapshot into the name readers use, after the checks pass. Readers never see the half-built copy.

  29. 29.Blue-green

    What is a blue-green table publish?

    Build the new version beside the current one, check it, then point the name at it. The old version remains for a rollback.

  30. 30.Dependency

    How do you model a pipeline dependency?

    A downstream job starts from the upstream snapshot it actually read, not from a clock that hopes the upstream is done.

  31. 31.Late-bind

    A fact arrives before its dimension. What do you do?

    Load the fact with the key, and allow the dimension lookup to miss until the dimension row arrives, or hold the fact.

  32. 32.Delete-prop

    How do deletes propagate?

    The change feed includes the delete, and every downstream merge applies it. A pipeline that only inserts never forgets a row.

  33. 33.Gdpr

    What does a deletion request demand of the design?

    A way to find that person's rows in every table, including raw and backups, within the time you promised.

  34. 34.Replay-env

    Why keep the raw log immutable?

    A logic bug can be fixed and the mart rebuilt from the log. If you transformed in place, the original is gone.

  35. 35.Test-fixture

    What do you replay in a pipeline test?

    A small log with a duplicate, an update, a delete, and a late event, asserted against the table you expect.

  36. 36.Monitor

    What do you alert on besides task failure?

    Freshness, row-count change, and null rate. A job that succeeds on zero rows is a failure the task status will not show.

  37. 37.Owner

    Who owns a table in the design?

    The team that can change its definition and answer when it is wrong. A table with no owner will be used anyway.

  38. 38.Discover

    What belongs in a table's catalog entry?

    The grain, the freshness, the owner, and the definition of each metric column. A name alone will be misused.

  39. 39.Compat-read

    How do you change a column readers use?

    Add the new column, move readers, then remove the old one. Dropping it in the same change breaks today's dashboards.

  40. 40.Sample

    When is a sample the wrong serving path?

    When the user needs a correct total. A sample is for exploration. A published metric is computed on the full grain.

  41. 41.Agg-table

    What is an aggregate table?

    A precomputed rollup at a coarser grain, so a dashboard does not scan the raw fact. It has to be rebuilt when the fact changes.

  42. 42.Drift

    What is definition drift?

    The same metric name computed differently in two pipelines. A single definition, stored once, is how you stop it.

  43. 43.Watermark-design

    Why expose a watermark?

    So a reader knows up to what event time the table is complete, and does not treat a partial trailing window as final.

  44. 44.Multi-region-d

    How do you place a pipeline across regions?

    Keep the raw data in the region that requires it, and be explicit about which aggregates are allowed to leave.

  45. 45.Schema-reg

    Where does a schema registry sit?

    Between producers and the raw log, so an incompatible event is rejected before it is the warehouse's problem.

  46. 46.Backpressure

    What happens when the warehouse cannot absorb the stream?

    The ingest lags, on purpose, instead of dropping events or crashing. The freshness SLO tells you when that lag is an incident.

  47. 47.Partition-evolve

    Can you change a partition column later?

    It is a rewrite of the table. Choose it for the filter you actually run. Changing it is a migration, not a setting.

  48. 48.Small-dim

    How do you join a tiny dimension to a huge fact?

    Broadcast the dimension, or filter the fact first. Shuffling the fact to match a hundred-row dimension wastes the cluster.

  49. 49.Retention

    What is a retention rule?

    How long each layer is kept. Raw logs, snapshots, and marts do not need the same lifetime, and backups count.

  50. 50.Run-id

    Why stamp a run id on produced files?

    So a failed or wrong run can be identified and removed without a full restore.