The Rise and Fall of the OLAP Cube (2020)
holistics.io
holistics.io
Actually, no. We model our data this way so it can be used for business decisions. It doesn't take long for any entity of any scale to discover that the logging and eventing done for heartbeat status, debugging, and scaling is just different than what you need to make a variety of business decisions.
You can solve with more events at different scales (button clicks nested in screen views) or pick events or event rolkups that appear to be clean business stages ("completed checkout") but still, your finance team, marketing group, all have different needs.
So, you decide to have some core shared metrics, derived and defined, and make them usable by everyone. Folks agree on the defns, and due to ease and trust, you see more data supporting more decisions.
You discover that some folks are doing 10 table joins to get an answer; it's fast but difficult to extend for new questions. You decide to build a view that solves some of these pains, and refactoring to allow a better time dimension. Your version links with the metrics you created, and the resulting queries shed tons of CTEs while becoming readable to the average user.
And now, you have some ELT pipelines, some event transforms that result in counts and filters that map nicely to your business needs but still allow you to get atomic raws, and you and your teams start to trust in consistent results. Your metrics are mostly clearly summable, and ones that aren't are in table views that precalc the "daily uniques" or other metrics that may need a bit special handling.
You've started modeling your data.
No, we don't need olap cubes. But we do need some type of rigor around analytic data. Otherwise, why go to all the trouble to collect it, count it, and predict from it if it may be wrong with no measure of that uncertainty?
And yeah, Kimball et al are from a world where olap was the answr, but it turns out they solved a broader set of sql problems. So, worth learning the good, toss the dated, and see what good data modeling can do for your analysis and predictions.
This model doesn't need to be OLAP cubes, but it's also not that easy to find something better.
Yeah, that would be my disagreement as well.
Sure, some of Kimball might be obsoleted by modern technology. But I don't think the point of Kimball is cubes, and even if it was, what better is there?
I'd be really interested in what else is there, that is more modern and suited to the modern world.
Data Vault? That probably isn't it, most of all because it's all about the "platform to build you Kimball on" but not the actual business modelling. (But the parts about Metrics Vault and Quality Vault and the "service stuff" are really good.)
Anchor Modelling? That one seems, looking by 2021 eyes, like a way to implement columnar storage and schema-on-read in MS SQL Server using store procedures ... which is probably not actually a good idea.
Puppini Bridge aka. Unified Star Schema seems like interesting concept, especially in self-service space. But even it's proponents warn you it doesn't scale performance-wise and also it is kind of incremental change on Kimball. (But the way the bridge table is kinda adjacency matrix of graph of your objects tickles my inner computer scientist fancy)
So really, what else is there?
It's a modeling approach that separates data modeling from data querying -- meaning that once data is modeled, it can answer any number of questions. The base building blocks of the data model can be combined at query time without having to figure out explicit foreign key joins.
Modern data warehouses don't need to build cubes for performance reasons. Low latency data warehouses like ClickHouse or Druid can aggregate directly off source data. The biggest driver for modeling is allowing non-coders to access data and perform their own analyses. I don't see that problem ever going away. Cube modeling with dimensions and measures solves it well.
The opposite is true too. Be suspicious of companies trying to lock you into their selfservice of data visualization tool. I have seen many BI tool vendors trying lock their clients into their tool. As result they get unnecessary complex models running.
I find the olap a pretty good mental model. That developers and users can understand.
The sheer amount of handwritten, tailor made etl or elt pipelines is something I like to see automated or replaced with something better.
But not all BI tools are alike - something like Superset which internally uses SQL and expects users to do self-service transformation using views is easy to industrialize since you already have the queries. Something like Tableau, not so much.
(If only Superset were more mature)
1. "OLAP Cubes" arguably belong to Microsoft and refer to SQL Server cubes that require MDX queries. It's a solution given to us by Microsoft that comes with well understood features. "OLAP" itself is a general term used to describe any database used for analytical processing, so OLAP has a wide range of uses.
2. OLAP Cubes (as defined above) started to decrease in population in 2015 (I'd argue).
3. Any solution to fixing "OLAP" that comes from a commercial vendor is suspicious. As painful as Kimbal & Inmon are, they are ideas that don't require vendor lock in.
4. At my current company, we recently wrapped up a process where we set out to define the future of our DW. Our DW was encumbered by various design patterns and contractors that came and went over the past decade. We analyzed the various tables & ETLs to come up with a clear set of principles. The end result looks eerily close to Kimball but with our own naming conventions. Our new set of principles clearly solve our business needs. Point being you don't need Kimball, Inmon, Looker, etc to solve data modelling problems.
5. Columnar databases are so pervasive these days that you should no longer need to worry about a lack of options when choosing the right storage engine for your OLAP db.
6. More and more data marts are being defined by BI Teams w/little modeling/CS skills. To that end, I think it's important to educate your BI teams as a means to minimize the fallout, and be accommodating in your DW as means to work efficiently with your BI teams. This is to say settle on a set of data modelling principles that work for you, but may not work for someone else.
Some of our ETLs were created by people that were not familiar with Kimball. We went about defining new data modeling guidelines, taking the good parts out of this work, eliminating the bad parts, and many of the good parts share a lot in common with Kimball.
Snowflake is the cubeless column store.
And now firebolt comes along, promising order of magnitudes improvement. How? Largely “join indexes” and “aggregation indexes” which seem to smell like cubes.
So take the modern column store and slap some cubes in front.
In firebolt this seems to be added by programmers. But I think the future will see olap mpp engines that transparently pick cubes, maintain them, reuse them and discard them all automatically.
Just curious. What stops snowflake from adding these too. Trying to understand what innovation firebolt is doing.
I only understand these systems about as well as you can without actually fighting them in production, so ymmv ;)
There are things that Firebolt are doing regards SSD caching that its easy to see are going to massively help performance but also hinder one nice aspect of Snowflake which is that one Snowflake region can read-only access the storage of another. I'm guessing that this is via direct S3 access, but the moment there is tiered storage, inter-cluster and inter-region access would have to be inter-compute-cluster instead etc.
SELECT dimension, measure
FROM table
WHERE filter = ?
GROUP BY 1
You can save a lot of compute time by creating a materialized view [1] of: SELECT dimension, filter, measure
FROM table
GROUP BY 1, 2
and the query optimizer will even automatically redirect your query for you! At this point, the main thing we need is for BI tools to take advantage of this capability in the background.[1] https://docs.snowflake.com/en/user-guide/views-materialized....
e:
I believe (I could be wrong!) you edited the second query from
SELECT dimension, measure
FROM table
GROUP BY 1
To SELECT dimension, filter, measure
FROM table
GROUP BY 1, 2
This addresses the filtering but how is that any different from the original table? Presumably `table` could have been a finer grain than the filter and dimension but you’d do better to add the rest of the dimensions as well, at which point you’re most of the way to a star schema.This kind of pre-computed aggregate is typical in data warehousing. But is it really an “OLAP cube”?
In general I agree there is value in the methods of the past and we would be well served to adapt those concepts to our work today.
I wouldn’t call this an “OLAP Cube”. It’s just an aggregated fact table. A collection of those with their corresponding dimensions is a “data mart”.
The new generation ELT tools such as dbt partially solve this problem. You can model your data and incrementally update the tables that can be used in your BI tools. Looker's Aggregate Awareness is also a great start but unfortunately it only works for Looker.
We try to solve this problem with metriql as well: https://metriql.com/introduction/aggregates The idea is to define these measures & dimensions once and use it everyone; your BI tools, data science tools, etc.
Disclaimer: I'm the tech lead of the project.
It seems like a very similar technology and also the webpages for both are almost identical.
We love Looker and wanted bring the LookML experience to existing BI tools rather than introducing a new BI tool, that's how metriql was born. I believe that Lightdash is a cool project especially for data analysts who are extensively using dbt but metriql targets users who are already using a BI tool. I'm not particularly sure which pages are identical, can you please point me?
I though you are affiliated somehow, but looking at it now, it seems you just use the same documentation website generator :)
It would be great if we can team up to build an open specification for the metric definitions though.
> coined the term Online analytical processing (OLAP) and wrote the "twelve laws of online analytical processing". Controversy erupted, however, after it was discovered that this paper had been sponsored by Arbor Software (subsequently Hyperion, now acquired by Oracle), a conflict of interest that had not been disclosed, and Computerworld withdrew the paper.
That kind of thing still totally counts as a scandal.
1. GROUP BY multiple fields (your dimensions), or
2. partition/shuffle/reduceByKey
and materializing/caching the result of this query for later reuse, you are rolling your own OLAP Cube with whatever data processing ecosystem you have on hands.
The technology itself has clear use cases and incredible business value on a daily basis, only implementation details differ depending on surroinding ecosystem
So simple, so powerful. I wish something open source would do this painfully obvious thing.
And this isn't possible to do in the data warehouse why exactly? Most every company seems to use DBT so even analysts can write transforms to generate tables and views in the warehouse from other tables. Hell, even Fivetran lets you run DBT or transformations after loading data.
Sometimes just exploring the data allows stuff like that to pop out.
Are there similar interfaces with columnar stores? Or do all the analytics need to be pre compiled? The ability to slice/dice/filter/aggregate your data in perhaps non obvious ways is really the value of business analytics in my opinion.
Cubes usually allow ad-hoc real-time queries that business users can play around with and explore.
What you are describing is just a data warehouse with a reporting tool. There’s dozens of options for building something like that.
A data warehouse is always “OLAP” but it isn’t often a “cube”.
OLAP is the combined methods that allow you to analyze the data, roll it up, aggregate it, combine it across dimensions etc. Usually by using a star schema.
A OLAP Cube, then, is the full multidimensional schema and relations of all the data. Typically a cube lets you define how each type of field is aggregated, whether it’s summing count fields, averaging dollar fields, or special rules for date fields etc. In addition you specify hierarchies of the data, so for instance City belongs to State belongs to Country, etc.
Once it’s all defined and the ETLs transfer your OLTP data into the OLAP system, then the cube allows for complicated ad-hoc queries. An example is a spreadsheet like cube explorer that allowed you to “slice”, “dice”, “drill”, and “pivot” in real time.
https://en.wikipedia.org/wiki/OLAP_cube#Operations
The queries are run by the tool as you change the “cube spreadsheet” real time. Typically aggregates are precomputed to speed things up.
So as I understand columnar data systems, especially if we’re talking not defining cube multidimensional schema, then some database engineer needs to program each view of the data as requested by the consumers of the data.
So as I understood the article, columnar databases let you get away with all the slicing and dicing etc in a performant way due to the database architecture and speed. Without defining the multidimensional cube schema upfront. The problem is, that seems to me to mean, those definitions are just being created later by the query designers, instead of upfront. I haven’t seen, nor does the article talk about any tools that can replace the tools that OLAP cube systems typically have that let you take advantage of that predesigned cube schema.
Here’s a single example called JPivot in action. The is running MDX queries in the cube as it’s manipulated:
The bit you’re missing is that a “cube” usually refers to a separate data store and compute engine to the data warehouse, queried via a different language such as MDX, typically meaning a proprietary tool is now required to get access. Usually this is also a subset of the data i.e. the cube designer has to decide what data is not included in the cube.
The people saying they don’t see the value of cubes are essentially saying they prefer multidimensional analysis on directly on top of a different stack: a relational, OLAP, columnar data warehouse, queried via SQL, with access to all the data.
It looks like the article is written by a vendor of such tools and hosted on their website, and others are mentioned throughout the thread.
Wouldn't that be two columns?
There are questions which require examining all the data, but often you don't really need to.
Columnar databases can also have indices. If there is an index by date (or time) then you DB will know row range from the index and will read only price column within given row range. If there is no index by data it would be two columns, but it is still much less than a full row with many columns.
Maybe "past 5 years" mean "over everything" and then it might technically be one column.
Or if you're using something like S3 with Parquet for "columnar database" and it is partitioned by date, then the date values are stored in metadata - so you would logically read two columns but physically only read one from storage. Same story for something like Redshift and using date as sortkey.
The Rise and Fall of the OLAP Cube - https://news.ycombinator.com/item?id=22189178 - Jan 2020 (53 comments)
I much prefer the current setup I work under: We have an ODS with a whole bunch of denormalized views for the most commonly needed data built on incremental updates to a clone of the production database. If one of the views doesn't have the data required or it's not structured as required I can simply bring one of the cloned prod tables into my SQL query.
If I find myself repeating that process for the same data often, I create another view for it, but I always have all of the data needed for any analysis or exploration.
If I need up-to-the-second data I can write the boilerplate using ODS and cloned prod, then join to only live prod data required.
Things like the added complexity of a constructing a pivot table in SQL are a non issue. Report writing software handles that and with a lot more flexibility to the end user for interaction.
But like others have said here, eventually you might find a novel pattern or something worth tracking on a regular, go-forward basis, and will want it to built into the data warehouse, for all of the various benefits a data warehouse provides for everything else it does so well.
But the use case was for various analysts (statisticians, linguists, etc., or any internal users other teams of the table). As their quires might use any column they like - there was probably a way to track down which columns got used over a time, but since it was used for launching new things, you would not know - better be safe than sorry I guess.
Anyway, I'm still fascinated that this terabyte thing got converted using 20k machines for few hours and worked! (it wasn't streaming, it was converting over and over from the begining, this might've changed too!)
There are several OSS solutions but I still weep every time I think about the stupid reasons for which we delayed open-sourcing it. It was such a simple and scalable data model including many concepts that were not common at the time. https://medium.com/hstackdotorg/hbasecon-low-latency-olap-wi...
I still believe there's room for a similar simple approach, likely taking advantage of some of the developments related to Algebird, Calcite, Gandiva, etc.
OLAP was a departure from OLTP, online transaction processing, the mainstay of business transactional networks. And of course, both are contrasted to batch processing which occurs later or after the fact, though in practice, much OLAP was specific triggered reports or ad hoc analysis, at least from the world as I saw it.
Where OLTP and OLAP differ is in that OLTP deals with a transaction at a time, typically following a single entity or account through a single transaction or operation. The data loads are small though the transaction counts are high, and there's virtually no summation of information. Database optimisation is built around these needs.
OLAP, in theory, was based around realtime or near-realitime access to transactional data, but the analysis looked across entities (typically accounts, products, divisions, regions, time, etc.), and relied heavily on summarised data (counts, sums, means, medians, min, max, standard deviation, occasionally other metrics). This was typically rationalised by either defining views, or (more often in my experience) by precomputing what were thought to be sufficient and useful summary statistics. (In practice, neither ambition ever seemed to be reliably met, requiring returning to source or disaggregated data.)
From a statistical stadpoint, one of the chief failures of OLAP is that it attempts to substitute summarisation for sampling. In practice, a small sample of a very large dataset is quite frequently orders of magnitude more easily compiled and analysed, with very little loss of information. Even aggregate computations can often be closely estimated by this method.
The article explicitly makes most of these points, FWIW.
With self-service BI tools like looker and other tools, Business folks are running more adhoc queries than traditionally piped data through ETL processes.
[1] https://www.singlestore.com/blog/memsql-singlestore-then-the...
I agree with Mr. Chin who is the author of this blog. OLAP cubes can scale up but not out which limits their potential size so they can't really accommodate big data scenarios. My previous company used Apache Druid instead. Druid can do a lot of what OLAP did but using a distributed approach. Although Druid does not provide tight integration with spreadsheets, it does provide near real-time ingestion, on-the-fly rollup, and first class time series analysis.
cubes whether tabular (columnar database) or multidimensional provide a language mdx or dax, that basically allows parametric measures (or queries)
which is essential in data analysis
sql for now, doesnt allow parametric functions or queries in the same way dax or mdx does
Less compute time, less time for business users since they don’t need to figure out star schema joins. Storage is cheap.
* Really big data (~ PB/day), which makes it impractical to process every analytics query by going back to the source
* User data subject to GDPR-like retention constraints, where you cannot usually hold on to the base data for ad long as you need analytics for
Like every other hype, it settled down to a realistic set of use cases that NoSQL databases rock at, and the world recognized that other use cases weren't their thing, and you stopped hearing about the death of SQL, the expectation that you'd never need a SQL DB or join again, etc.
So, not a fad, but past the hype-beyond-belief stage and now into the "gets stuff done" stage.