Chapter 01 · Data Warehouse Foundations: OLTP vs OLAP, Analytical Workloads, Architecture, and Lab Dataset

Define a Course Case Study with Source Systems, Business Processes, KPIs, SLAs, Security, and Data Quality Expectations

Freeze the AtlasMart source, process, KPI, freshness, security, and quality contract that all later warehouse-design chapters will evolve explicitly.

Intermediate → Advanced100–120 minutesCase-study contract labSynthetic JSON · Python validatorLast reviewed: September 2026

Learning outcomes

The remaining 29 chapters need one stable case study so examples do not mutate silently. AtlasMart therefore needs a written contract for sources, business processes, candidate analytical questions, KPI semantics, freshness commitments, security boundaries, and data-quality expectations. This lesson creates that baseline without prematurely designing the star schema that Chapters 02–06 will derive.

01

Inventory AtlasMart source systems with ownership, extraction mechanism, authority, freshness, and failure assumptions.

02

Define business processes and decision questions before choosing tables.

03

Write precise baseline KPI formulas and identify intentional exclusions.

04

Distinguish SLA/SLO, data quality, security, and privacy responsibilities.

05

Create a machine-checkable case-study manifest that later chapters can version rather than silently redefine.

Design restraint

This lesson records business/source contracts but does not finalize fact or dimension tables. Chapter 02 will declare grain from decisions and business processes; Chapters 03–11 will turn that requirements evidence into dimensional structures and history policies.

1. Source systems and authority

Source Authority in the case study Initial ingestion shape Case-study freshness expectation Sensitive content
ERP Orders, order lines, payments, returns 15-minute extract initially; CDC may be introduced later 95% of committed order changes certified within 30 minutes Customer IDs, commercial transactions
CRM Customer profile and segment attributes Daily extract at 02:00 UTC Certified customer view by 03:00 UTC PII and segmentation
Product service Product/category/reference data Hourly extract Certified within 2 hours Low sensitivity, but commercial metadata
Inventory service On-hand snapshot by product/location 30-minute snapshot Certified within 45 minutes of source snapshot Operational inventory
Web/app events Session and behavioral events Hourly files for the baseline Certified within 2 hours Pseudonymous identifiers
Finance reference FX rates and accounting calendar Daily file Available before daily finance reporting Financial reference data

“Authority” means which source owns the operational meaning in this fictional case study. It does not mean the warehouse should query that source for every dashboard request. Ingestion preserves the source key, source timestamp/position, ingestion batch identity, and raw evidence needed for replay where policy permits.

2. Business processes come before schemas

Business process Representative event/state Primary decisions/questions
Order capture Order and order-line commitment Sales trend, channel mix, customer/product performance
Payment Authorization/capture/refund event Paid value, payment success, settlement exposure
Return Returned line/item event Return rate, returned value, product/customer patterns
Inventory Inventory level at a snapshot time Stock exposure, stockout risk, replenishment
Fulfillment Shipment/milestone event/state Order-to-ship time, backlog, late fulfillment
Customer lifecycle Profile/segment changes Customer mix and historical segmentation
Marketing response Campaign exposure/click/conversion Campaign effectiveness with attribution caveats

The table describes business reality, not warehouse tables. One process can later require several fact-table types, and one physical table must not mix incompatible grains merely because columns overlap.

3. Baseline KPI contracts must expose filters and exclusions

Metric Baseline definition for Chapter 01 Grain/aggregation warning
paid_gmv Sum quantity × unit_price for order lines whose parent order status is paid Additive across included atomic lines in this fixture; taxes, shipping, discounts, returns, and currency conversion are excluded.
paid_order_count Distinct order_id where status is paid Do not sum pre-aggregated distinct counts across overlapping groups.
average_paid_order_value paid_gmv ÷ paid_order_count Derived ratio; recompute from numerator/denominator rather than averaging subgroup AOVs.
units_sold Sum quantity on paid order lines Pending/cancelled lines excluded by the same baseline status rule.
on_hand_units Sum current inventory on_hand for the chosen snapshot Semi-additive across time; summing multiple snapshots would be wrong.

For the Chapter 01 fixture, paid_gmv = 625, paid_order_count = 4, average_paid_order_value = 156.25, paid units are 9, and current on-hand units are 137. Those numbers are control totals for this synthetic dataset only.

Metric evolution rule

If a later chapter adds returns, discounts, taxes, multi-currency conversion, or payment settlement semantics, create a new/versioned metric contract and reconcile the change. Do not silently change the meaning of paid_gmv in existing lessons.

4. SLA, SLO, freshness, and quality are different contracts

An SLO is an internal target for service/data behavior; an SLA is a formal commitment whose consequences depend on the organization’s agreement. This course does not invent a legal contract. AtlasMart’s case study records operational targets and a fictional business availability commitment so later lessons have something measurable.

Data quality is separate from freshness. A dataset can arrive on time and be wrong. The baseline quality rules include required keys, positive quantities, nonnegative prices/inventory, referential integrity, uniqueness at the source key, accepted status values, and exact reconciliation of certified paid-GMV totals to the defined source control population.

5. Security and privacy are end-to-end properties

Identity / audience Baseline access Explicit denial
ingestion service Write raw/staging evidence for assigned sources No interactive BI role; no unrelated source domains
analytics engineering Transform synthetic/course data; production equivalent gets scoped engineering access No routine use of unrestricted production credentials
analyst Read certified presentation/semantic objects No direct raw PII by default
finance analyst Read finance-certified metrics and approved dimensions No unrelated CRM raw attributes
BI service identity Read only objects required by published reports No write access to source/raw/integration layers
break-glass admin Time-bounded emergency administration with audit Not a daily analyst or pipeline identity

Dashboard row/column filters are not sufficient if the same user can bypass them through raw-table access or exports. Later chapters test effective privileges, lineage, copies, backups, and retention rather than assuming the front-end policy is the whole control.

6. Controlled failure: a KPI spreadsheet becomes the source of truth

Finance emails a spreadsheet containing “revenue,” sales copies the number into a dashboard, and data engineering later ingests the dashboard export because it is convenient. The lineage becomes circular: the reported output feeds the analytical input, the original filter logic is unknown, and reconciliation to the ERP is impossible.

The repair is to keep source authority and derived certification explicit. Human corrections can be legitimate, but they need their own governed input contract, owner, reason, effective period, and audit trail; they must not masquerade as original source evidence.

7. Hands-on lab — freeze the Chapter 01 AtlasMart contract

Save the contract below as atlasmart_contract.json. It is intentionally small; later chapters may extend it only by explicit versioned change.

atlasmart_contract.json
{  "case_study": "AtlasMart",  "timezone": "UTC",  "sources": [    {"id":"erp","authority":["orders","order_lines","payments","returns"],"freshness_slo_minutes":30},    {"id":"crm","authority":["customer_profile","customer_segment"],"freshness_slo_minutes":60,"schedule":"daily 02:00 UTC"},    {"id":"inventory","authority":["on_hand_snapshot"],"freshness_slo_minutes":45}  ],  "metrics": {    "paid_gmv": {"formula":"sum(quantity * unit_price) for parent orders where status = paid","fixture_control":625},    "paid_order_count": {"formula":"count distinct paid order_id","fixture_control":4},    "average_paid_order_value": {"formula":"paid_gmv / paid_order_count","fixture_control":156.25},    "on_hand_units": {"formula":"sum(on_hand) for one chosen inventory snapshot","fixture_control":137}  },  "quality": {    "required_keys":["order_id","customer_id","product_id"],    "rules":["quantity > 0","unit_price >= 0","on_hand >= 0","referential integrity holds"]  },  "security": {    "raw_pii":"restricted",    "certified_analytics":"least privilege",    "bi_service":"read only"  }}
validate_contract.py
import jsonfrom decimal import Decimalfrom pathlib import Pathc = json.loads(Path("atlasmart_contract.json").read_text(encoding="utf-8"))assert c["case_study"] == "AtlasMart"assert c["timezone"] == "UTC"assert {s["id"] for s in c["sources"]} >= {"erp", "crm", "inventory"}for s in c["sources"]:    assert s["authority"], s["id"]    assert s["freshness_slo_minutes"] > 0m = c["metrics"]assert Decimal(str(m["paid_gmv"]["fixture_control"])) == Decimal("625")assert m["paid_order_count"]["fixture_control"] == 4assert Decimal(str(m["average_paid_order_value"]["fixture_control"])) == Decimal("156.25")assert m["on_hand_units"]["fixture_control"] == 137assert c["security"]["bi_service"] == "read only"print("contract valid")print("sources:", [s["id"] for s in c["sources"]])print("metrics:", sorted(m))

Run python validate_contract.py. Expected evidence is contract valid, the source IDs, and the sorted metric names. Deliberately change paid_gmv.fixture_control from 625 to 626; the validator must fail. Restore it and rerun.

Cross-check against the SQL fixture: paid GMV 625, four paid orders, AOV 156.25, on-hand 137. Cleanup: delete only atlasmart_contract.json and validate_contract.py from the lab directory.

8. What later chapters are allowed to change

Chapter 02 may refine requirements and declare fact-table grain. Chapters 03–11 may introduce fact/dimension structures, surrogate keys, SCDs, bridges, snapshots, and correction policy. Chapters 12–16 may formalize source contracts, quality, incremental/CDC behavior, and orchestration. Later chapters may change physical layout, semantic tooling, cloud platform, or lakehouse integration.

What must not change silently is the evidence chain: source authority, business event meaning, metric version, history policy, security requirement, control totals, and migration/reconciliation procedure. A course case study is useful only when each chapter can explain how its new design preserves or deliberately changes that chain.

9. Chapter 01 acceptance checklist

  • AtlasMart source systems and authorities are named.
  • Business processes are described without prematurely equating them to tables.
  • Baseline KPI formulas and fixture control totals are explicit.
  • Freshness targets identify source/consumer boundaries.
  • Security roles separate ingestion, engineering, analyst, BI, and emergency administration.
  • Data-quality rules are measurable and reconciled.
  • All mandatory artifacts are local, synthetic, replayable, and deletable.
  • Physical warehouse/cloud/lakehouse product choice remains open.

10. Production judgment and bridge to Chapter 02

AtlasMart now has enough stable context to design analytically without guessing. The next chapter starts from stakeholders and decisions, identifies business processes, declares grain in one precise sentence, and builds a requirements-to-model traceability matrix. That order matters: the warehouse model should be a consequence of questions and source reality, not a diagram chosen first.

Knowledge check

Check your understanding

  1. Why does Chapter 01 avoid finalizing fact and dimension tables?
  2. What is the difference between source authority and analytical certification?
  3. Why is average_paid_order_value not safely additive across subgroups?
  4. How can data be fresh but still fail data-quality expectations?
  5. What must happen if a later chapter changes the meaning of paid_gmv?
Review the answers

1. Because Chapter 02 must derive grain and model requirements from business decisions and source events before physical/logical dimensional structures are selected.

2. Source authority identifies where the operational fact originates; analytical certification identifies a governed derived object whose transformations, quality, and semantics are approved for consumption.

3. It is a ratio. Averaging subgroup ratios weights each subgroup equally rather than by its underlying order count; recompute from total numerator and denominator.

4. A pipeline can deliver on time while containing duplicates, invalid keys, broken references, wrong units, or incorrect business filters.

5. Create an explicit version/change, document new filters or components, reconcile old and new control totals, update lineage/tests, and preserve compatibility or migration behavior instead of silently overwriting the definition.

Summary and next step

Chapter 01 ends with a reproducible AtlasMart contract: sources, processes, metrics, freshness, quality, security, and control totals are explicit while physical implementation remains open.

Continue to Chapter 02: Start from Decisions and Questions: Stakeholders, Use Cases, Reports, Explorations, and Data Products.

Authoritative references

Keep knowledge open

Help the academy stay free and grow.

If these tutorials save you time, a small donation supports new lessons, technical review, diagrams, examples, and long-term maintenance.

ETHEthereum / ERC-20 only
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0

Send only Ethereum or ERC-20 compatible assets to this address.