Skip to content

Data Modelling for Analytics

For people

Star schemas, facts and dimensions: how to design tables that make analysis fast, consistent and easy to understand.

Editorial team 2 min read

Share X LinkedIn Reddit Bluesky Email

Data modelling organises data into tables that are easy to query and hard to misuse. For analytics, dimensional modelling is the classic approach.

Facts and Dimensions

  • Fact tables record events or measurements: orders, payments, website visits. They contain numeric measures (amount, quantity) and keys to dimensions.
  • Dimension tables describe the context: customers, products, dates, stores. They contain descriptive attributes used for filtering and grouping.

The Star Schema

A central fact table connected to surrounding dimension tables looks like a star. Queries join facts to the dimensions they need. It's simple for analysts and efficient for databases.

Grain

Define the grain of each fact table precisely: one row per order line, per daily account balance, per page view. Mixing grains in one table causes double counting.

Slowly Changing Dimensions

Attributes change — a customer moves city. Decide whether to overwrite (type 1) or keep history with effective dates (type 2), so past facts are analysed with the attributes valid at the time.

Other Approaches

  • Wide denormalised tables: convenient for specific use cases and BI tools.
  • Data vault: flexible modelling for integrating many sources, with more complexity.

Good Practice

  • Consistent naming and definitions.
  • Shared, conformed dimensions (one customer table used everywhere).
  • Documented tables and columns.
  • Tests for keys, uniqueness and relationships.

More in Data engineering

All Data engineering guides →
Data engineering Guide · 2 min

What Is Data Engineering?

What data engineers do, how data flows from source systems to analysis and AI, and the core skills involved.

Data engineering 2 min read 28 Jan 2026 For people

Data engineering Guide · 2 min

ETL Versus ELT

The difference between transforming data before loading and after, and why modern warehouses shifted the default to ELT.

Data engineering 2 min read 27 Jan 2026 For people

Data engineering Guide · 1 min

Data Warehouses, Data Lakes and Lakehouses

The three main architectures for analytical data storage, what each is good for and how they are converging.

Data engineering 1 min read 26 Jan 2026 For people

Data engineering Guide · 1 min

Batch Versus Streaming Data Processing

When to process data in scheduled batches and when real-time streaming is worth the added complexity.

Data engineering 1 min read 24 Jan 2026 For people

Discussion 0

Use @handle to bring somebody in, and #tag to file it.

Nothing here yet. Ask a question, or say how you used it.

Sign in to join the discussion. Sign in