← Football data warehouse
8 min readPart 1 of 4

What is a data warehouse — and why build one?

Part 1 of my football data warehouse series: what a data warehouse is, the problem it solves, how ETL works, and the architecture I chose.

Data Warehouse SeriesData EngineeringSQLFootball Analytics

What is a data warehouse?

A data warehouse is a subject-oriented, integrated, time-variant and non-volatile collection of data that supports decision-making. In plain English:

Subject-oriented

Organised around a business area, like players, transfers or matches.

Integrated

Brings data from multiple sources together in one place.

Time-variant

Keeps historical data, not just the latest snapshot.

Non-volatile

Once data is in, it isn't deleted or changed on the fly.

Why do we need one?

Imagine three analysts each building reports from three different sources. Each one collects and transforms the data in their own way. One report covers the last 40 days, another the last 10, another the last 5. Nobody can say exactly how each number was produced.

That causes real problems:

With a data warehouse, a data engineer builds an ETL pipeline that automatically extracts, transforms and loads data from every source into one place. The data is integrated and historic, and analysts work from a single source of truth — so they can spend their time answering questions instead of wrangling data.

The kitchen analogy: a good warehouse is like a well-organised kitchen. Ingredients arrive, get prepared and are stored neatly, ready to use. The chef simply takes what they need to make each dish.

What is ETL?

ETL stands for extract, transform, load. Each step has a few options.

Extract

Method

  • Pull — you fetch the data
  • Push — the source sends it

Type

  • Full — everything, every time
  • Incremental — only what's new or changed

Technique

  • Database queries
  • File parsing
  • API calls
  • Event streaming
  • Change data capture
  • Web scraping

Transform

Load

Processing

  • Batch — load on a schedule
  • Stream — load continuously

Full loads

  • Truncate and insert — empty the table, reload it
  • Upsert — update existing rows, insert new ones
  • Drop, create, insert — rebuild the table from scratch

Incremental loads

  • Upsert
  • Append — add new rows only
  • Merge — update, insert and delete

Slowly changing dimensions

  • SCD0 — never update
  • SCD1 — overwrite (history is lost)
  • SCD2 — add a new row for each change and keep the old one

Choosing an architecture

There are four common ways to manage analytical data:

  1. Data warehouse — structured, cleaned data ready for reporting. This project's focus.
  2. Data lake — stores anything in raw form. Flexible, but it can easily become a “data swamp”.
  3. Data lakehouse — a mix of the two.
  4. Data mesh — no central platform; each domain builds and shares its own data products.

How to build a data warehouse

ApproachHow it worksTrade-offs
InmonRaw data lands in staging, is modelled into an enterprise data warehouse (in third normal form), then subsets become data marts for reporting.One integrated, enterprise-wide model — but slower and more work up front.
KimballSkips the enterprise warehouse and builds data marts straight from staging.Quicker — but without the bigger picture, you can end up repeating the same transformations in different marts.
Data vaultSplits the warehouse into a raw vault (original data) and a business vault (business logic), then builds data marts.More standards and rules, and adapts well to change — but more complex.
MedallionThree layers: bronze (raw), silver (cleaned) and gold (business-ready).Simple, easy to understand and flexible for many uses — not just reporting.

The medallion architecture

I chose the medallion architecture. Its strength is a strict separation of concerns: each layer has one job.

Bronze

Ingest only. Raw data, exactly as it arrives. Useful for tracing and debugging issues back to the source.

Silver

Clean only. Cleansing and standardising — but no business rules yet. Data never jumps straight from source to silver.

Gold

Business logic only. No cleaning here — just data products for reporting, analysis and machine learning.

High-level architecture: player, game and competition CSV files flow into bronze, silver and gold layers in PostgreSQL, then out to BI and reporting, ad-hoc SQL queries and machine learning.
The high-level architecture for the football data warehouse, built in PostgreSQL.

In the next part, I'll set up the project and load the raw data into the bronze layer.

See the code

Everything is on GitHub

All the SQL scripts, the load script and the diagrams for this project are in the repository.