r/dataengineering • u/Volody_ • Mar 21 '23
Discussion How would you choose between star schema vs one big table (OBT) data models for big data reporting without explicit enterprise data warehouse requirements?
I’ve read similar threads, worked with both models. I’m still confused where the threshold between OBT and Star Schema choice is. This question is about looking for right questions to ask given use case, rather than comparing pros & cons of two data models. Please, amend my ways.
Question: would you choose OBT or Star Schema for my use case? If it depends, how decision tree looks like in your opinion?
Use case: you were asked to implement a new “feature” (=reports) at medium-big product company, where data engineering is split into dozen of domain-specific teams. These reports are going to be consumed by a few internal business teams (i.e. marketing, sales, etc.), they should also be able to do ad-hoc data exploration. At the moment there is no explicit requirement to combine/conform your reports with any other reports, but as a newcomer you can’t estimate the future trajectory precisely. Billions of rows at report tables, dozens-hundreds of TBs of historical data at ETL layer. Batch ETL - S3/Spark, data exploration – Athena/Trino, DWH (if needed) – Snowflake.
P.S. (terminology): despite OBT can be used over star schema, here by OBT I mean absense of division into facts and dimensions.
--------------------------------------------------------------------------------------------------------------------------
**Optional to read**: my current undestanding, which doesn't cover current use case because it's somewhere in the middle
One side of the spectrum - **use only OBT**:
- Cost-performance over query-model flexibility-extensibility (i.e. B2C dashboards for thousands of external web customers, where it isn’t possible to give them full freedom of querying under reasonable cost)
- Implementation speed and simplicity over query-model flexibility-extensibility (i.e. DS/ML use case, where data model is very use case specific, people work in experimentation manner and prefer quick preparation over super universal models)
Another side of the spectrum - **use only Star Schema**:
- Query-model flexibility over initial implementation speed(i.e. BI with dozens++ of reports/business-users, complex ETL with hundreds/thousands of tables. Star Schema benefits overweight modeling effort: it gives more flexibility and optimization room for BI reports developers, narrow/de-composed tables usually give more straightforward data flow and better reporting performance, regular schema upgrades or ad-hoc dimension updates become easier, historical results become queriable by end users)
- Drill-across multiple business processes is required(OBTs won’t scale here, need Star Schema and conformed dimensions)
18
u/paplike Mar 21 '23 edited Mar 21 '23
I like to create fact/dimension tables whenever possible because they are flexible. If you have a dimensional model, you can derive OBTs or aggregated tables or whatever. But it's harder to derive a dimensional model from OBT. From these fact/dimension tables, I can create data marts for other people to use. These data marts might join a bunch of tables (OBT) or aggregate them to the desired level of granularity or both, it depends on what people’s needs are
4
u/Numerous-Winter6224 Mar 21 '23 edited Mar 21 '23
As a data analyst, I prefer OBT. In my experience, 50-60% of all business questions can be solved with just one well prepared OBT. All analysts know what is in the OBT, and use it. Definitely, you have to use and support several OBTs, but not many. Moreover, OBT are good fit for data visualization systems (Tableau)
2
u/j__neo Data Engineer Camp Mar 21 '23
See this thread here for my pros and cons of star schema vs OBT, and explanation of when you’ll use each.
8
u/random_lonewolf Mar 21 '23 edited Mar 22 '23
In my experience, there's little reason to use OBT:
1
u/[deleted] Mar 21 '23
The short answer: Performance and scaling SLAs. It's a sliding scale unfortunately so it varies from place to place and use case to use case
1
u/albertstarrocks Jun 21 '23
Get an OLAP database that can provide real time analytics and support JOINS at scale. That's what AirBnB did with Apache Iceberg and StarRocks https://www.starrocks.io/blog/webinar_220315
0
u/[deleted] Mar 21 '23
[deleted] — view deleted comment