RDBMS Star Schema
The Star Schema is a popular database schema design used in data warehousing. It is named for its resemblance to a star, where a central fact table is surrounded by dimension tables.
Components of Star Schema
- Fact Table: Contains the quantitative data for analysis, such as sales amounts or quantities. The fact table links to dimension tables through foreign keys.
- Dimension Tables: Store descriptive attributes related to the facts, such as product names, customer details, or dates.
Example of Star Schema
Consider an e-commerce sales data warehouse:
- Fact Table: Sales
- Dimension Tables:
- Product (ProductID, ProductName, Category, Price)
- Customer (CustomerID, CustomerName, Region, AgeGroup)
- Date (DateID, Date, Year, Quarter, Month)
- Store (StoreID, StoreName, Location)
Advantages
- Simplicity: Easy to understand and query.
- Optimized Query Performance: Efficient joins between fact and dimension tables.
- De-normalization: Reduces the number of joins needed for queries.
Disadvantages
- Redundancy: Can lead to increased storage requirements.
- Limited Flexibility: Best suited for simple queries.