The normalized schema of the previous lesson is ideal for recording orders: each piece of data lives in a single place and the constraints prevent inconsistencies. But business questions are not about recording; they are about comparing, grouping and adding up: "how much did we sell yesterday by category and by city?". For that job there is a different design technique, dimensional modeling, which for decades has been the usual way of organizing consumption-ready data.

This lesson explains its concepts (facts, dimensions, granularity, types of measures), compares the star schema with the snowflake schema and deals with two issues the operational model does not solve: how to preserve history when a customer's data changes and how to make every report talk about the same customers, products and dates. We will design DataCorp's sales star, with its DDL and the query that answers UC-01. This model will live in the platform's consumption-ready data zone.

Why the normalized schema does not serve analytics well

Let's try to answer UC-01 (daily net sales by category and city) on the operational schema:

SELECT CAST(o.order_date AS DATE)                              AS sales_date,
       p.category,
       c.city,
       ROUND(SUM(ol.quantity * ol.unit_price) / 1.21, 2)       AS net_sales
FROM order_lines ol
JOIN orders    o ON o.order_id    = ol.order_id
JOIN products  p ON p.product_id  = ol.product_id
JOIN customers c ON c.customer_id = o.customer_id
WHERE o.status NOT IN ('cancelled', 'returned')
GROUP BY CAST(o.order_date AS DATE), p.category, c.city;

It works, but it has four underlying problems:

  1. It is hard to write and easy to write wrong. Four tables and three joins for a simple question. Every analyst who rewrites it may forget the status filter or the division by 1.21: this is the origin of DataCorp's contradictory figures (RQ-11).
  2. It does not preserve history. customers.city holds the current city. If Lucía moves from Valencia to Bilbao, all her past purchases start being counted in Bilbao, and last year's report changes without anyone having touched it.
  3. It has no calendar. Grouping by quarter, by day of the week or by "sales week" has to be calculated in every query.
  4. It is designed for writing. Its organization and its indexes favor row-by-row operations, not massive aggregates. Besides, according to ADR-001, it cannot even be queried for analytical purposes.

Dimensional modeling gives up normalization in exchange for simplicity for whoever queries and speed for whoever aggregates. That is acceptable because in analytical storage there are no users modifying rows: the data is written by a controlled process, which alone is responsible for maintaining consistency.

Facts and dimensions

Dimensional modeling, popularized by Ralph Kimball, divides data into two kinds of tables.

  • A fact table records what happens in a business process and can be measured: a sale, an inventory movement, a click. It contains numeric measures (quantity, amount) and keys that point to the dimensions. It has many rows and few columns, and it never stops growing.
  • A dimension table describes the context of the fact: who, what, when, where. It contains descriptive attributes (city, category, month name), which are used for filtering, grouping and labeling. It has few rows and many columns.

A business question always breaks down the same way: "net sales (measure) by category and city (dimension attributes) in October (filter on a dimension)". The word "by" usually announces a dimension.

Fact table Dimension table
Answers How much? How many? Who? What? When? Where?
Content Numeric measures and keys Descriptive attributes, mostly text
Size Millions of rows From dozens to hundreds of thousands
Growth Continuous Slow
At DataCorp Order lines sold Customers, products, dates

Granularity

Granularity, or grain, is the exact definition of what one row of the fact table represents. It is the most important decision in the design, and it is made before any other.

For DataCorp's sales there are several options:

Grain One row is... Rows per day Allows analysis by product
Order line One product within an order 3,750 Yes
Order A complete order 1,500 No
Day and category The daily total for a category A few dozen By category only

The rule is to choose the finest grain available, the so-called atomic grain. From the detail you can always summarize; from a summary you can never recover the detail. A table at order grain could not answer UC-01, because a single order can contain products from several categories.

The grain of fact_sales will be one row per order line. With 3,750 rows a day and six years of retention that is about 8 million rows, a modest amount for a columnar store.

Once the grain is declared, every measure and every dimension must be consistent with it. Mixing grains in the same table (for example, repeating the order's total_amount on each line) means that adding up counts things several times.

Types of measures: additive, semi-additive and non-additive

Not all measures can be added up freely.

Type Can be added... Example at DataCorp What to do
Additive Across all dimensions Quantity sold, amount Add without restrictions
Semi-additive Across some, but not across time Units in stock: they add up across products and fulfillment warehouses, not across days Across dates, use the average or the value on the last day
Non-additive Never Unit price, margin percentage, conversion rate Store the additive components and calculate the ratio at query time

The stock case is revealing: if a warehouse has 100 units on Monday and 100 on Tuesday, it does not have 200. And so is the case of percentages: the month's return rate is not the average of the daily rates, but the month's returns divided by the month's sales. That is why you store the numerator and the denominator, never the ratio.

Star schema and snowflake schema

Star

In the star schema, the fact table sits at the center and each dimension is a single denormalized table connected directly to it.

erDiagram
    DIM_DATE ||--o{ FACT_SALES : "when"
    DIM_CUSTOMER ||--o{ FACT_SALES : "who"
    DIM_PRODUCT ||--o{ FACT_SALES : "what"

    FACT_SALES {
        int line_id PK
        int order_id
        int date_sk FK
        int customer_sk FK
        int product_sk FK
        string order_status
        int quantity
        decimal gross_amount
        decimal net_amount
    }
    DIM_DATE {
        int date_sk PK
        date full_date
        int year_number
        int month_number
        string day_name
    }
    DIM_CUSTOMER {
        int customer_sk PK
        int customer_id
        string city
        date valid_from
        date valid_to
    }
    DIM_PRODUCT {
        int product_sk PK
        int product_id
        string name
        string category
    }

dim_product contains the category in every row, repeated thousands of times. In an operational schema that would be a normalization defect; here it is deliberate.

Snowflake

In the snowflake schema, the dimensions are normalized: the attributes that form a hierarchy are extracted into tables of their own.

erDiagram
    DIM_CATEGORY ||--o{ DIM_PRODUCT : "classifies"
    DIM_PRODUCT ||--o{ FACT_SALES : "what"
    DIM_CITY ||--o{ DIM_CUSTOMER : "locates"
    DIM_CUSTOMER ||--o{ FACT_SALES : "who"
    DIM_DATE ||--o{ FACT_SALES : "when"

Comparison

Criterion Star Snowflake
Dimensions Denormalized, one table each Normalized into several tables
Joins per query One per dimension Several per dimension
Ease of use for analysts and tools High Lower
Query performance Better Somewhat worse
Redundancy in the dimensions Yes No
Space used Somewhat more Somewhat less
Maintaining the hierarchies Many rows have to be updated One row is updated

The snowflake's space saving is irrelevant in practice: dimensions are small, and in a columnar store a column with repeated values compresses almost completely (lesson 02-01). The simplicity of the star, on the other hand, is felt in every query. The general recommendation, and DataCorp's decision, is to use the star by default and reserve the snowflake for specific cases, such as a very large hierarchy shared by several dimensions.

The date dimension

Almost every fact table has a date, and almost every analysis filters or groups by it. Instead of calculating the quarter or the day of the week in every query, you build a table with one row per day and with all the calendar attributes already worked out.

date_sk full_date year_number quarter_number month_number month_name day_of_week day_name is_weekend
20261117 2026-11-17 2026 4 11 November 2 Tuesday false
20261118 2026-11-18 2026 4 11 November 3 Wednesday false

Its advantages:

  • Readable queries: WHERE d.year_number = 2026 AND d.is_weekend.
  • The business calendar: holidays, campaigns ("Black Friday", "January sales") or the fiscal year are added as columns, something no date function knows how to calculate.
  • Consistency: every report defines "week" or "quarter" in the same way.
  • Days with no data: because every day exists, days with no sales can be shown.

The date dimension is the exception to the rule of meaningless keys: an integer in YYYYMMDD format (20261118) is used, which is readable and sortable. It is generated just once for the whole period needed; twenty years is about 7,300 rows.

Surrogate keys in dimensions

Each dimension has a surrogate key of its own within the analytical store (here with the suffix _sk, for surrogate key), distinct from the identifier in the source system, which is kept as one more attribute (customer_id). In the dimensional world it is justified on three grounds:

  1. It makes it possible to store several versions of the same customer, each with its own customer_sk. It is the basis of history tracking, which we will see next.
  2. It insulates you from the source systems. If the store changes platform and renumbers its customers, or if another source is integrated with its own identifiers, the fact tables are not affected.
  3. It makes it possible to represent the unknown. A special row is reserved (for example customer_sk = 0, "Unknown") for facts whose customer is not identified. That way the key in the fact is never null and no sale disappears from the totals when the tables are joined.

Slowly changing dimensions (SCD)

The attributes of dimensions change from time to time: a customer moves, a product is reclassified. These are called slowly changing dimensions (SCD), and you have to decide, attribute by attribute, what to do with the previous value.

Suppose Lucía (customer_id = 1042) moves from Valencia to Bilbao on November 10, 2026.

Type What it does Result for Lucía History
Type 1: overwrite Replaces the old value One row: city = Bilbao Lost. Her past purchases appear in Bilbao
Type 2: new row Closes the current row and creates another with a new surrogate key Two rows: Valencia (until November 10) and Bilbao (from then on) Complete. Each sale stays tied to the city at the time
Type 3: new column Adds a column with the previous value One row: city = Bilbao, previous_city = Valencia Only the last change

When to use each one:

  • Type 1, to correct errors or when history is of no interest: a typo in the name, a change of email address.
  • Type 2, when the analysis must reflect the situation at the time of the fact. It is the most widely used.
  • Type 3, for one-off cases where you want to compare "before and after" a single change, such as a reorganization of sales territories.

Different types coexist within the same dimension. In dim_customer, name and email will be type 1, and city, type 2, because UC-01 asks for sales by city and Laura needs past reports not to change.

Type 2 in SQL

Type 2 adds three control columns to the dimension: valid_from, valid_to and is_current. Before the change:

customer_sk customer_id name city valid_from valid_to is_current
5871 1042 Lucía Ferrer Valencia 2023-03-14 9999-12-31 true

The change is applied in two steps, within a single transaction:

BEGIN;

-- Step 1: close the current version of customer 1042
UPDATE consumption.dim_customer
SET valid_to   = DATE '2026-11-10',     -- it stops being valid on that day
    is_current = FALSE
WHERE customer_id = 1042
  AND is_current;

-- Step 2: insert the new version, with a new surrogate key
INSERT INTO consumption.dim_customer
    (customer_sk, customer_id, name, email, city, signup_date,
     valid_from, valid_to, is_current)
VALUES
    (8203, 1042, 'Lucía Ferrer', '[email protected]', 'Bilbao', DATE '2023-03-14',
     DATE '2026-11-10', DATE '9999-12-31', TRUE);

COMMIT;

After the change:

customer_sk customer_id name city valid_from valid_to is_current
5871 1042 Lucía Ferrer Valencia 2023-03-14 2026-11-10 false
8203 1042 Lucía Ferrer Bilbao 2026-11-10 9999-12-31 true

Key points:

  • The old sales are not touched. They still point to customer_sk = 5871 (Valencia). Those after November 10 will point to 8203 (Bilbao). History is preserved without modifying a single fact row.
  • The interval is half-open: a version is valid from valid_from (inclusive) to valid_to (exclusive). That way versions never overlap or leave gaps.
  • 9999-12-31 represents "no end date". It avoids nulls and simplifies comparisons.
  • Counting customers requires care: COUNT(*) on the dimension counts versions. To count people you use COUNT(DISTINCT customer_id) or the is_current filter.

When a sale is loaded, the right surrogate key is looked up with the order date:

-- Version of the customer in force on the order date
SELECT customer_sk
FROM consumption.dim_customer
WHERE customer_id = 1042
  AND DATE '2026-10-03' >= valid_from
  AND DATE '2026-10-03' <  valid_to;      -- returns 5871 (Valencia)

In practice, these operations are run automatically by the transformation processes of Module 4. What matters here is understanding the result they must produce.

Conformed dimensions and the bus matrix

DataCorp will not have one star, but several: sales, inventory, campaigns, browsing, tickets. If each one defined its own customers and products, silos would reappear inside the platform. A conformed dimension is a single dimension, with the same keys and the same attributes, shared by all the fact tables that need it.

Conformed dimensions make it possible to cross-reference different processes: comparing a product's sales with its tickets (UC-05) is only reliable if "product" means exactly the same thing in both stars.

The bus matrix is Kimball's planning tool: a table with the business processes in the rows and the dimensions in the columns.

Business process (fact table) Date Customer Product Warehouse Campaign Use cases
Sales (fact_sales) X X X UC-01, UC-02, UC-06
Daily inventory (fact_daily_inventory) X X X UC-03, UC-06
Campaign results (fact_campaigns) X X UC-02
Web browsing (fact_web_events) X X X UC-04
Support tickets (fact_tickets) X X X UC-05

How it is used:

  • The columns with many marks are the dimensions to build first and best. Date, customer and product serve almost everything.
  • Each row is a deliverable project. You start with the one that serves the priority use cases (sales) and add the others by reusing the existing dimensions.
  • It makes gaps visible. UC-02 needs to relate sales to campaigns, but today orders do not record which campaign generated them. The matrix exposes that missing piece of data, which will have to be resolved when the marketing source is integrated.

Types of fact tables

Type One row represents Modified after being inserted Example at DataCorp
Transactional An event at a point in time Normally not fact_sales: one order line
Periodic snapshot The state at the end of each period No: each period adds rows fact_daily_inventory: stock of each product in each warehouse, every day
Accumulating snapshot A process with a beginning and an end, across its stages Yes, every time a stage is completed fact_order_lifecycle: one row per order, with the payment, shipping and delivery dates
  • The transactional type is the most common and the most flexible.
  • The periodic snapshot is needed when what matters is the level and not the movement. DataCorp's ERP exports inventory in exactly this way: 15,000 products times 3 warehouses, 45,000 rows a day. Its measure, units in stock, is semi-additive.
  • The accumulating snapshot is used to measure durations between stages ("how many days go by between payment and delivery?") and is the only one of the three in which updating rows is normal.

DataCorp's sales star

Design decisions

Decision Value Reason
Business process Online store sales It appears in all six use cases
Grain One row per order line Atomic grain; UC-01 needs the category
Dimensions dim_date, dim_customer, dim_product Those in the bus matrix
Date of the fact The order date This is what the official definition of net sales establishes
Measures quantity, gross_amount, net_amount All three are additive
History dim_customer.city as type 2; the rest, type 1 UC-01 analyzes by city
Location The consumption schema in the consumption-ready data zone It is what analysts and dashboards query

Two details deserve an explanation:

  • gross_amount and net_amount are calculated at load time, just once: the gross amount is quantity × unit_price (VAT included) and the net amount, the gross amount divided by 1.21. No analyst ever writes the division again (RQ-11). The unit price, which is not additive, is not stored as a measure.
  • order_id and line_id are stored in the fact table without a dimension of their own. They are called degenerate dimensions: identifiers that are useful for counting orders or tracing a piece of data back to its origin, but with no attributes to justify another table. order_status is also kept in the fact because it is involved in the net sales rule.

DDL

-- ============================================================
-- DataCorp's sales star (consumption zone)
-- ============================================================

CREATE TABLE consumption.dim_date (
    date_sk         INTEGER      PRIMARY KEY,   -- YYYYMMDD format: 20261118
    full_date       DATE         NOT NULL UNIQUE,
    year_number     SMALLINT     NOT NULL,
    quarter_number  SMALLINT     NOT NULL,      -- 1 to 4
    month_number    SMALLINT     NOT NULL,      -- 1 to 12
    month_name      VARCHAR(12)  NOT NULL,      -- 'November'
    day_number      SMALLINT     NOT NULL,      -- 1 to 31
    day_of_week     SMALLINT     NOT NULL,      -- 1 = Monday ... 7 = Sunday
    day_name        VARCHAR(12)  NOT NULL,      -- 'Wednesday'
    is_weekend      BOOLEAN      NOT NULL
);

CREATE TABLE consumption.dim_customer (
    customer_sk  INTEGER      PRIMARY KEY,       -- surrogate key of the analytical store
    customer_id  INTEGER      NOT NULL,          -- identifier in the source
    name         VARCHAR(100) NOT NULL,          -- type 1; personal data (RQ-10)
    email        VARCHAR(150) NOT NULL,          -- type 1; personal data (RQ-10)
    city         VARCHAR(80)  NOT NULL,          -- type 2; 'Unknown' if missing
    signup_date  DATE         NOT NULL,
    valid_from   DATE         NOT NULL,          -- start of validity (inclusive)
    valid_to     DATE         NOT NULL,          -- end of validity (exclusive)
    is_current   BOOLEAN      NOT NULL
);

CREATE TABLE consumption.dim_product (
    product_sk  INTEGER       PRIMARY KEY,
    product_id  INTEGER       NOT NULL,
    name        VARCHAR(150)  NOT NULL,
    category    VARCHAR(50)   NOT NULL,
    list_price  NUMERIC(10,2) NOT NULL          -- current price; type 1
);

CREATE TABLE consumption.fact_sales (
    -- Degenerate dimensions: identifiers from the source, with no table of their own
    line_id       INTEGER       PRIMARY KEY,     -- the grain: one order line
    order_id      INTEGER       NOT NULL,
    -- Keys to the dimensions
    date_sk       INTEGER       NOT NULL REFERENCES consumption.dim_date (date_sk),
    customer_sk   INTEGER       NOT NULL REFERENCES consumption.dim_customer (customer_sk),
    product_sk    INTEGER       NOT NULL REFERENCES consumption.dim_product (product_sk),
    -- Order attribute needed for the net sales rule
    order_status  VARCHAR(20)   NOT NULL,
    -- Measures (all additive)
    quantity      INTEGER       NOT NULL,
    gross_amount  NUMERIC(12,2) NOT NULL,        -- quantity x unit_price, with VAT
    net_amount    NUMERIC(14,4) NOT NULL         -- gross_amount / 1.21, without VAT
);

Remarks:

  • net_amount has four decimal places. Dividing by 1.21 produces fractions of a cent; if each line were rounded to two decimal places, the sum of millions of lines would drift away from the real total. It is stored with more precision and rounded at presentation time.
  • In dim_customer, customer_id is not unique, because there can be several versions of the same customer. Uniqueness belongs to the pair (customer_id, valid_from).
  • The name and the email address are in the dimension, but analysts must not see them (RQ-10). Masking is dealt with in lesson 03-04.
  • Many analytical stores accept PRIMARY KEY and REFERENCES but do not enforce them. They are informational. Integrity must be guaranteed by the load process and verified with quality checks (lesson 03-03).
  • An order changes status after it is created. The load process will have to update order_status when that happens; we will see how in Module 4.

The query that answers UC-01

-- UC-01: daily net sales by category and city, November 2026
SELECT d.full_date                     AS sales_date,
       p.category,
       c.city,
       COUNT(DISTINCT s.order_id)      AS num_orders,
       SUM(s.quantity)                 AS units,
       ROUND(SUM(s.net_amount), 2)     AS net_sales
FROM consumption.fact_sales s
JOIN consumption.dim_date     d ON d.date_sk     = s.date_sk
JOIN consumption.dim_customer c ON c.customer_sk = s.customer_sk
JOIN consumption.dim_product  p ON p.product_sk  = s.product_sk
WHERE d.year_number  = 2026
  AND d.month_number = 11
  AND s.order_status NOT IN ('cancelled', 'returned')   -- definition of net sales
GROUP BY d.full_date, p.category, c.city
ORDER BY d.full_date, p.category, c.city;

Compare it with the query at the beginning of the lesson:

  • All the joins have the same shape: the fact table with each dimension, through its surrogate key. There are no chains of tables to remember.
  • The date filter uses readable attributes (year_number, month_number) and not functions.
  • The city is the one at the time of purchase, thanks to type 2: Lucía's October sales appear in Valencia.
  • The net amount is already calculated. To group by quarter or by day of the week, you only have to change the dim_date columns.

One point remains open: the status filter is still written in the query. So that the definition of net sales resides in a single place, this query will be materialized as an official table in the consumption zone (the consumption.daily_net_sales announced in lesson 01-03, now broken down by category and city), and the tools will read from it. How metrics are published and governed is studied in lesson 05-03.

Common Mistakes and Tips

  • Not declaring the grain. If you cannot complete the sentence "one row of this table represents...", the design is not finished.
  • Mixing grains in a fact table. Repeating a header amount on each line produces multiplied totals.
  • Adding up semi-additive or non-additive measures. Adding the stock of several days, or averaging percentages, gives meaningless figures that nobody questions because "the system calculated them".
  • Using the source identifier as the dimension key. It prevents storing versions and ties the analytical store to an operational system.
  • Applying type 1 for convenience. Overwriting is easier, but it rewrites the past. Decide the type of each attribute with the business.
  • Normalizing dimensions out of habit. The reflex acquired in operational design leads to the snowflake needlessly.
  • Creating separate dimensions for each star. Two versions of "customer" are two truths. Use conformed dimensions.
  • Tip: always follow the same order: business process, grain, dimensions and, last, measures.
  • Tip: fill the dimensions with readable descriptions ("Delivered", not "D"; "Wednesday", not 3). The dimensions are the user interface of the analytical store.

Exercises

Exercise 1: Grain and measures

For DataCorp's fact_daily_inventory table (every night the ERP exports the units in stock of each product in each warehouse):

  1. State the grain.
  2. Which dimensions does it need? Which ones are conformed with the sales star?
  3. What type of fact table is it?
  4. Laura adds up stock_units for the whole of November for one product and gets 12,600. What has she done wrong and what should she calculate?

Exercise 2: A product changes category

On December 1, 2026, product 5120 ("Air BT Headphones", product_sk = 311) moves from the "Electronics" category to the new "Audio" category. Management wants earlier sales to keep counting under "Electronics".

  1. Which SCD type has to be applied to category?
  2. Which columns would have to be added to dim_product?
  3. Write the SQL statements for the change, using 9544 as the new surrogate key. Assume a list price of €59.00 and that the current version has been valid since 2024-01-01.

Exercise 3: Querying the star

Write a query on the sales star that returns, for the year 2026, net sales and units sold by category, separating weekdays from weekends. How many tables do you need?

Solutions

Exercise 1

  1. One row per product, warehouse and day.
  2. dim_date, dim_product and dim_warehouse. The first two are conformed: they are the same tables that fact_sales uses. dim_warehouse is new.
  3. A periodic snapshot.
  4. She has added a semi-additive measure across time: 12,600 is the sum of 30 daily snapshots (an average of 420 units), not a real quantity of product. She should calculate the month's average stock (AVG, after adding up the warehouses for each day) or the closing stock (the value on the last day).

Tip: document in the data catalog which measures are semi-additive; we will see how in lesson 03-02.

Exercise 2

  1. Type 2: the category in force at the time of each sale has to be preserved.
  2. The same control columns as in dim_customer: valid_from, valid_to and is_current.
  3. The statements:
BEGIN;

UPDATE consumption.dim_product
SET valid_to   = DATE '2026-12-01',
    is_current = FALSE
WHERE product_id = 5120
  AND is_current;

INSERT INTO consumption.dim_product
    (product_sk, product_id, name, category, list_price,
     valid_from, valid_to, is_current)
VALUES
    (9544, 5120, 'Air BT Headphones', 'Audio', 59.00,
     DATE '2026-12-01', DATE '9999-12-31', TRUE);

COMMIT;

The earlier sales keep product_sk = 311 (Electronics); the new ones will use 9544 (Audio). Common mistake: running an UPDATE of the category on the existing row. That is type 1, and it would move all past sales to "Audio".

Exercise 3

Three tables are enough: the facts, dim_date and dim_product. The customer dimension is not involved, so it is not joined.

SELECT p.category,
       CASE WHEN d.is_weekend THEN 'Weekend' ELSE 'Weekday' END AS day_type,
       SUM(s.quantity)               AS units,
       ROUND(SUM(s.net_amount), 2)   AS net_sales
FROM consumption.fact_sales s
JOIN consumption.dim_date    d ON d.date_sk    = s.date_sk
JOIN consumption.dim_product p ON p.product_sk = s.product_sk
WHERE d.year_number = 2026
  AND s.order_status NOT IN ('cancelled', 'returned')
GROUP BY p.category,
         CASE WHEN d.is_weekend THEN 'Weekend' ELSE 'Weekday' END
ORDER BY p.category, day_type;

Notice that is_weekend comes already worked out in the date dimension. In the operational schema you would have to extract the day of the week from order_date with a function that, on top of that, varies from one engine to another.

Conclusion

Dimensional modeling organizes data for analysis into fact tables, which contain the measures of a business process at a declared grain, and dimension tables, which provide the context for filtering and grouping. We have distinguished additive, semi-additive and non-additive measures; we have compared the star with the snowflake and chosen the former for its simplicity; and we have seen the pieces that make the model robust: the date dimension, surrogate keys, slowly changing dimensions (with type 2 to preserve history), conformed dimensions planned with the bus matrix and the three types of fact tables. DataCorp now has its first star designed in the consumption schema: fact_sales at order-line grain, with dim_date, dim_customer and dim_product, and a simple query that answers UC-01 with the right city at each point in time.

The model defines which tables there will be in the consumption-ready data zone. One last step down remains, the physical one: in object storage, those tables (and the raw and cleansed data that feed them) are, in the end, files. In what format are they written? How are they distributed into folders so that a query does not have to read all of them? We will see that in the last lesson of the module, devoted to file formats and partitioning.

© Copyright 2026. All rights reserved