Skip to main content

Practice: E-commerce Platform

Premium

Scenario: You're designing a data model for Amazon's e-commerce platform to analyze sales performance, customer behavior, and inventory management.

Requirements:

  • Track daily sales totals by product category
  • Analyze customer purchase history for segmentation
  • Calculate average order value (AOV) and customer lifetime value (CLV)
  • Monitor product inventory levels
  • Evaluate the effectiveness of marketing campaigns

Task: Create a high-level dimensional model to support these requirements.

Identify the core business process. What is the central event that generates most of the required metrics? Think about what happens when a customer makes a purchase.

Identify potential dimensions. Consider the "who, what, where, when" of the core business process. Who is involved in a sale? What is being sold? When does the sale occur?

Identify potential facts. What numerical values are generated when the core business process occurs? Think about quantities, amounts, and counts.

Consider slowly changing dimensions. Which entities might have attributes that change over time, and how should these changes be tracked?

Think about granularity. At what level of detail do you need to store data to support all the required analyses? Consider the trade-offs between granularity and performance.