8 Database Schema
8 Database Schema
Schema is a logical description of the entire database. It includes the name and
description of records of all record types including all associated data-items and
aggregates. Much like a database, a data warehouse also requires to maintain a
schema. A database uses relational model, while a data warehouse uses Star,
Snowflake, and Fact Constellation schema.
Data warehouse schema is a blueprint for how data will be stored and
managed. It includes definitions of terms, relationships, and the
arrangement of those terms and relationships.
Star, galaxy, and snowflake are common types of data warehouse schema
that vary in the arrangement and design of the data relationships.
Star schema is the simplest data warehouse schema and contains just one
central table and a handful of single-dimension tables joined together.
Snowflake schema builds on star schema by adding sub-dimension tables,
which eliminates redundancy and reduces overhead costs.
Galaxy schema uses multiple fact tables (Snowflake and Star use only one)
which makes it like an interlinked star schema. This nearly eliminates
redundancy and is ideal for complex database systems.
The basic components of all data warehouse schemas are fact and dimension
tables. The different combination of these two central elements compose almost
the entirety of all data warehouse schema designs.
Fact Table
Dimension Table
Just like the relationship between the foreign key in the fact table and the primary
key in the dimension table, with the snowflake schema approach, a primary key
in a sub-dimension table will relate to a foreign key within the higher order
dimension table.