Data Cubes and Data Warehouses: What’s the Difference?

Aditya Sahu
Curious Data Catalog
5 min readDec 1, 2021
Photo by Franki Chamaki on Unsplash

One of the most valuable assets of any organization is its data, and understanding how to store it and pull useful insights from it is crucial. This article highlights the key differences between data warehouses and data cubes. Both serve the same purposes, but each comes with its pros and cons.

With a drastic increase in the amount of data being produced, it has become crucial for organizations to plan a way to efficiently store, process, and analyze the data. Organizations often struggle to decide whether to build a data warehouse (or even a cloud data warehouse, which offers even more) or implement data cubes for business intelligence and reporting. Understanding the differences between the two will help us decide on a better solution for an organization’s needs.

That being said, let’s first understand what a data warehouse is.

Data Warehouse

Data is almost always used for two purposes: operational record storage and analytical decision making. In very simple terms, operational systems are where you put data in, and data warehouses are where you get data out. The users of operational systems turn the wheel of an organization — they take orders, sign up customers, etc.

Operational systems are optimized to deal with transactions quickly. These systems almost always deal with a single transaction at a time. These systems often do the same task over and over again. Given this kind of execution flow, these systems do not need to maintain any log. Rather, updates are made to include the latest records.

On the other hand, the users of the data warehouse watch the wheel of an organization turn to evaluate performance and generate metrics. They look for answers such as how many orders were sold, what customers complained about, how the last campaign to generate revenue went, etc. These users often deal with hundreds of thousands of transactions at a time to generate a single result set.

Data warehouse users require historical data to be preserved to evaluate the company’s performance over a period of time. In simple terms, these systems store cleaned and structured data in the form of tables to answer business questions. As the amount of data being generated continues to grow, the industry adapts with a cloud data warehouse as they scale to the need, provide cheap storage, and come with massively parallel processing (MPP) capabilities.

Now, let’s understand what a data cube is.

Data Cube

Source

By the mid to late 1990s, relational databases had come of age. Almost all big organizations use relational databases to store their data. But, with the adoption of relational databases came a problem: organizations found that relational databases are great for storing data but are not efficient at generating management reports from transactional data.

For instance, if we need the sales records for a given month, the transactional database has to loop through all the records and then generate the result for us, which requires a lot of time and computation. So, Dr. Codd looked at this problem and came up with a solution — online analytical processing (OLAP).

The idea behind OLAP was to pre-compute all the totals and subtotals needed for reporting at night or over the weekend when the database server was normally idle. These totals are stored in a special database called OLAP cubes or data cubes.

A data cube is a snapshot of data at a specific point in time, perhaps at the end of a specific day, week, month, or year. Building and managing data cubes requires knowledge of MDX (or MultiDimensional eXpressions) as opposed to knowledge of databases for building data warehouses.

Data Cubes vs. Data Warehouses

Both data cubes and data warehouses can provide information for business intelligence and reporting. Both work as OLAP solutions to provide insights from data. However, which one will suit you depends on the need and use case. So, it’s worth knowing the differences between the two.

Data Warehouse: Positives and Negatives

With the availability of cloud data warehouses and an architecture using MPP, it is easy to get insights from a growing amount of data. It’s just a matter of writing SQL statements, and the MPP architecture will take care of processing those SQL statements efficiently and quickly, even on large datasets.

Another advantage of a data warehouse is that it is based on concepts of relational databases, i.e., tables and relational data modeling, which makes it easier for IT people to get involved and maintain the system without any new skill set requirement.

Apart from this, cloud data warehouses can also auto-scale and reduce storage costs. This means that if the data analyst or business analyst’s team size increases, the data warehouse can auto-scale to serve their needs.

A notable disadvantage of data warehouses is that they take a reasonable amount of time and effort to build the system. Their use necessitates constant discussions between the business team and the IT team. Moreover, the IT team needs to have a clear understanding of business, along with source systems. It also requires a separate set of pipelines (ETLs) to process and ingest data from the source system to the data warehouse and needs to maintain the performance of these ETLs within the SLA.

Data Cube: Positives and Negatives

When data cubes first arrived on the scene, one notable benefit was that they were able to provide information pretty fast due to their nature of storing aggregated data. Also, business intelligence users were able to visualize data in multi-dimensional space. However, cloud data warehouses offer materialized views, which can also serve the same purpose. Moreover, building these materialized views does not require any specific training like MDX.

Building data cubes requires knowledge of MDX or a person with OLAP training. Moreover, data cubes are not like normal databases. They require a different set of training and knowledge to build and maintain the system.

Which One to Go For

The key takeaway from this blog is this: to select the best approach, try to understand your use case. What’s the skill set of your current IT team (whether they know SQL or MDX)? How much storage do you require? Do you need to visualize data in multidimensional space? Is your solution cloud based? What are the SLAs to get source data into the target data store? Since both solutions have pros and cons, understanding the difference and answering these questions will tell you which is the best option for you to build your BI and reporting infrastructure.

--

--