- Introduced by
- E. F. Codd and colleagues (Arbor Software)
- Year
- 1993
- Type
- Analytical data structure design
- Family
- Business Intelligence & Analytics
What does it do?
OLAP (Online Analytical Processing) cube design is the practice of structuring multidimensional data for interactive analysis.
Measures (facts) are organised along several dimensions (attributes), so users can navigate by pivoting, drilling down and aggregating. The multidimensional model and its roll-up and drill-down operations also have precedents in earlier statistical database research.
The intuition behind the method
Relational tables store records as rows and columns, whereas an OLAP cube organises the same measures along several analytical dimensions at once. A sales cube might have time, product, geography and customer dimensions, with measures such as revenue and quantity. Users can rotate (pivot) and slice the cube to view the data from different perspectives, drill down to detail, or roll up to summaries. Once the summary aggregates exist, many of these views can be answered from them without a new query against the underlying tables.
History
The multidimensional model at the core of OLAP has precedents in statistical database research, where the notions of multidimensional data, the association of measures with dimensions, and roll-up and drill-down also appear. In many organisations the cube is built on top of a data warehouse, which consolidates the data that OLAP tools analyse interactively. Modern OLAP implementations are commonly grouped into multidimensional (MOLAP) systems, which store data in specialised multidimensional structures, and relational (ROLAP) systems, which keep data in a relational database with a dimensional schema.
When to use it
Choose OLAP cube design when analysts repeatedly query the same measures across a known set of dimensions, and when drilling, rolling up and slicing are central to the work. It suits cases where the common aggregation paths can be anticipated and the dimension hierarchies are known in advance. The refresh schedule also matters: each refresh requires the pre-computed aggregates to be updated, so frequent refreshes raise maintenance cost, and the update strategy (full rebuild or incremental loading) should be chosen with the required data latency in mind. Do not choose it when dimensions and hierarchies change frequently, when the questions cannot be anticipated and the aggregation paths are unpredictable, or when the main need is row-level lookup of individual transactions.
Limitations and considerations
- The number of possible aggregation combinations grows rapidly with the number of dimensions and hierarchy levels, so storage needs can rise quickly
- Sparse cubes, in which most dimension combinations have no data, store and process many empty cells without adding information
- Adding a dimension or changing a hierarchy typically requires rebuilding the affected aggregates, which can be costly on large data
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Pre-computed aggregates allow many summary queries to be answered by lookup rather than by scanning the detailed fact rows
- Defined hierarchies give users named drill-down and roll-up paths, which keeps navigation consistent across reports
- The cube metaphor of slicing and rotating maps directly onto how business users usually organise their questions
Applications
- Retail chains analyzing sales by store, product, time period, and customer segment for merchandising decisions
- Financial institutions analyzing portfolios across asset class, geographic region, and risk category
- Manufacturing plants analyzing production metrics across facility, shift, product line, and quality dimension
- Healthcare organizations analyzing patient volumes by hospital, department, procedure type, and demographic group
How it works
How it works
List the measures to be analysed, such as revenue and quantity, and the dimensions along which each will be aggregated. Measures that do not add up across dimensions, such as ratios, should be identified at this stage because they cannot be summed like ordinary totals.
Define each dimension and its hierarchy levels (for example Year > Quarter > Month > Day), and decide which level combinations users actually need. The hierarchy definitions determine which roll-up and drill-down paths are valid.
Pre-compute summaries at the chosen levels, for example sales by country, region and store. Usually only the aggregates that serve frequent queries are stored in advance; the remaining ones are computed on demand. Additive measures such as revenue and quantity are summed along each dimension. Non-additive measures such as ratios or averages must be derived at the level being queried from their additive components (for example, total revenue divided by total quantity), rather than by adding up stored ratios from lower levels.
Build the cube in a dedicated OLAP server or in a relational engine with a dimensional schema and specialised indexing structures. The storage model chosen here determines how the aggregates are stored and queried.
Tune indexing and caching for the query patterns observed in use, so that frequently requested aggregates are returned without recomputation. Response times should be checked against realistic analyst queries rather than assumed.
Common pitfalls
- Pre-computing too many aggregates increases storage and the maintenance work needed each time the source data is refreshed
- Defining hierarchies incorrectly, for example with a level that does not roll up cleanly to its parent, blocks valid navigation and produces misleading totals
- Choosing dimensions that do not match the questions analysts actually ask results in a cube that is structurally sound but rarely useful
- Summing non-additive measures such as ratios or distinct counts across levels produces wrong totals, even when the cube structure itself looks valid
Frequently asked questions
What is the difference between OLAP and ROLAP?
OLAP is the general term for multidimensional analysis. MOLAP stores data in specialised multidimensional structures, whereas ROLAP (Relational OLAP) keeps the data in a relational database with a dimensional schema and computes aggregations from it, typically on demand. ROLAP is generally more flexible in its storage, but it is often slower for queries that would otherwise be answered from pre-computed aggregates.
How do I decide which aggregations to pre-compute?
Start with the high-level summaries that are queried most often, such as sales by country and month. Analyse the query patterns and the storage available, and pre-compute the aggregates that noticeably improve response time; compute the rest on demand.
What is a dimension hierarchy and why is it important?
A hierarchy defines roll-up relationships, for example Product > Category > Brand. Hierarchies enable drilling down to detail and rolling up to summaries. Properly designed hierarchies make cube navigation predictable for business users.
How do I handle slowly changing dimensions in a cube?
Track dimension changes using effective dating (valid from and valid to) or surrogate keys. This allows historical queries to show the dimension attributes that were correct at each point in time, avoiding misleading roll-ups across time.
Related methods
Sources
Codd, E. F., Codd, S. B., & Salley, C. T. (1993). Providing OLAP to user-analysts: An IT mandate. Arbor Software.
Open publication referencePedersen, T. B., Jensen, C. S., & Dyreson, C. E. (1999). A foundation for capturing the semantics of temporal multidimensional databases. Proceedings of the 5th ACM SIGMOD Workshop on Research Issues in Data Mining and Knowledge Discovery.
Open publication referenceKimball, R. (1996). The Data Warehouse Toolkit: Practical Techniques for Building Dimensional Data Warehouses. New York: John Wiley & Sons.
Open publication referenceData Mining: Concepts and Techniques, 3rd ed. (Morgan Kaufmann, 2011), p. 162
04-Data Warehousing and OLAP, p. 27