What Is A Star Schema
What Is A Star Schema
The star schema is the simplest type of Data Warehouse schema. It is known as star schema as its
structure resembles a star. In the Star schema, the center of the star can have one fact tables and
numbers of associated dimension tables. It is also known as Star Join Schema and is optimized for
querying large data sets.
For example, as you can see in the above-given image that fact table is at the center which contains keys
to every dimension table like Deal_ID, Model ID, Date_ID, Product_ID, Branch_ID & other attributes like
Units sold and revenue.
Every dimension in a star schema is represented with the only one-dimension table.
The dimension table is joined to the fact table using a foreign key
The Star schema is easy to understand and provides optimal disk usage.
The dimension tables are not normalized. For instance, in the above figure, Country_ID does not
have Country lookup table as an OLTP design would have.
A Snowflake Schema is an extension of a Star Schema, and it adds additional dimensions. It is called
snowflake because its diagram resembles a Snowflake.
The dimension tables are normalized which splits data into additional tables. In the following example,
Country is further normalized into an individual table.
The main benefit of the snowflake schema it uses smaller disk space.
The primary challenge that you will face while using the snowflake Schema is that you need to
perform more maintenance efforts because of the more lookup tables.
It contains a fact table surrounded by dimension One fact table surrounded by dimension table
tables. which are in turn surrounded by dimension table
Single Dimension table contains aggregated data. Data Split into different Dimension Tables.
Offers higher performing queries using Star Join The Snow Flake Schema is represented by
Query Optimization. Tables may be connected with centralized fact table which unlikely connected with
multiple dimensions. multiple dimensions.
A Galaxy Schema contains two fact table that shares dimension tables. It is also called Fact Constellation
Schema. The schema is viewed as a collection of stars hence the name Galaxy Schema.
As you can see in above figure, there are two facts table
1. Revenue
2. Product.
The dimensions in this schema are separated into separate dimensions based on the various
levels of hierarchy.
For example, if geography has four levels of hierarchy like region, country, state, and city then
Galaxy schema should have four dimensions.
Moreover, it is possible to build this type of schema by splitting the one-star schema into more
Star schemes.
The dimensions are large in this schema which is needed to build based on the levels of
hierarchy.
This schema is helpful for aggregating fact tables for better understanding.
Overlapping dimensions can be found as forks in hierarchies. A fork happens when an entity acts as a
parent in two different dimensional hierarchies. Fork entities then identified as classification with one-
to-many relationships.