Skip to main content

Difference between Star schema and Snowflake schema

Are you aware of the schema in the database? Why do we need schema? Let's answer all these questions. Schema primitively means a structure or a framework that can make your data organized. We know that data alone doesn't make any sense until and unless it is organized and structured which represents the logic of the data. When we talk about data warehouse fact tables and dimension tables make a schema. Mainly there are three types of schema- Star Schema, Snowflake Schema, and Galaxy Schema. In this blog, we will point out the difference between Star Schema and Snowflake Schema. Basically, the Snowflake schema is an advanced (pro) version of the star schema.

What is a Star Schema? It's a basic structure where the fact tables are placed at centered and they are surrounded by dimension tables. It will help you to differentiate your quantitative data from qualitative data. But why it is named star? To answer that you need to see the formation of fact tables and dimension tables in this schema. It forms a star shape between fact and dimension table. The design of this schema and takes very little time to execute queries. Since the design is simpler then it will have a lesser number of foreign keys. This sort of schema has a high data redundancy which means the same data can exist in a different place which can cause data inconsistency.


Source

What is Snowflake Schema? Till now you must be aware that why this schema is named like that is obvious because of its shape. It is an advanced version of the star schema. It is a multidimensional model where the fact tables are present at the center and they are surrounded by dimension tables but in this schema, the dimension tables divide themselves into one or more tables. Dimension tables will divide them until the data is normalized. Data normalization? It is a fancy word for data structuring which can reduce data redundancy. Due to the complex nature of this schema, it takes a longer time to execute queries. The number of foreign keys is more in this schema. This schema has a low data redundancy due to data normalization. Dividing dimension tables into various lookup tables can prove out to be a great aid in saving a lot of storage.



But the main question is which schema is to be used and under what scenarios? If you need to report a simpler dataset and execute basic queries then you should go for star schema but it won't allow many to many relationships it is much suitable for one to many relationships. According to my experience star schema works very well with BI tools such as Tableau. I have worked more with the star schema. In case if the fact table has many relationships with the dimension table then the snowflake schema can come to your rescue. The snowflake schema is a much better choice for RDBMS but not for OLAP. For OLAP you need denormalized data which can be obtained from Star Schema. Both the schemas have both pros and cons associated with them but it depends on your business requirements.



Thanks for Reading  Let's connect on  LinkedIn




Comments

Popular posts from this blog

Copying Bookmarks from one Power BI report to another

Let's think of a scenario, where you want to copy the bookmarks from one report to another. Most obvious approach is to just do a copy paste of the bookmarks. What's wrong with this approach? This approach only works for all visuals but not for bookmarks and field parameters.  If you are not familiar with basics of bookmarks and field parameters do refer to the beginners guide for bookmarks  and introduction to field parameters . Then how do you copy the bookmarks? Power BI enhanced report format (PBIR) for Power BI Project files (PBIP) will help you in achieving this. Let's check it out, I have 2 reports one contains the bookmark called Bookmarks PBIR Test (origin) and other one is Rolling Average PBIR Test (destination) .  Before we get started, you have to enable Power BI Project save option under preview features. Once enabled, restart Power BI desktop. There is a TMDL icon appearing on the left pane. What is TMDL and what's in it for me? There's a lot of possi...

Playing with Totals in Power BI

Are you a fan of matrix visual in Power BI? If you are as I am, I always struggle to get the correct totals and get something else instead of the totals it can be average. After a lot of research and going over different community posts, finally we have found 3 common scenarios that can elevate your matrix to the next level. To start with, I am using Sample Superstore data. Let's first explain the 3 different scenarios that we will tackle - We  would like  to show both Total Sales and Average Monthly Sales across different categories and different periods. We  would like  to show the Average Sales in the row subtotals and Total Sales in the column subtotals. Last and the  most interesting scenario is to show the Total sales excluding the furniture sales in the row subtotals and total sales in the column subtotals. Let's start by getting the correct totals in a matrix. Generally, if  use  basic Sum, Average... functions in your measures then most likely...

Introduction to Power Ops

Power BI, combined with all external tools, at least the basic ones, can be a perfect BI tool to meet all your needs. Today's blog will focus on another external tool. What?? Not another one!! In my regular practice, I always rely on basic external tools such as DAX Studio, Tabular Editor, and Measure Killer. But what if I say this new tool is a transformer, combining all the basic tools in one place? If you are looking for an introductory guide for the basic external tools, we got you covered.  Beginner's Guide to DAX Studio Advanced Guide to DAX Studio Guide to Measure Killer Yes, you read it right and we will give you an introductory guide to all the functionalities that can be achieved with  Power Ops . Okay, first things first to download Power Ops you can visit their  website  and I would recommend exploring it with one of your reports. You can download the free version. It will be available under the external tools section in Power BI Desktop. Before we move f...