← Lessons

quiz vs the machine

Silver1050

System Design

The OLAP Cube

Pre aggregating measures across many dimensions so analytic questions answer instantly.

4 min read · intro · beat Silver to climb

What an OLAP cube is

An OLAP cube is a multi dimensional view of data built for analysis rather than transactions. Instead of rows in a single table, you organize measures like revenue or units along dimensions like time, product, and region.

Why it helps

  • A business question is usually a slice and dice: revenue by region by month.
  • The cube pre aggregates these combinations so the answer is a lookup, not a full scan.
  • Operations have names: slice fixes one dimension, dice picks a sub range, roll up climbs to a coarser level, and drill down descends to a finer one.

The cost

Pre computing every combination is expensive in storage and refresh time, so engines materialize only the most useful aggregates and compute the rest on demand.

A cube trades extra build cost for fast interactive analysis, which is exactly what dashboards and analysts need.

Key idea

An OLAP cube pre aggregates measures across dimensions so analytic slice and dice queries return almost instantly.

Check yourself

Answer to earn rating on the learn ladder.

1. What does an OLAP cube primarily optimize for?

2. What does the roll up operation do?