I built an end-to-end ecommerce pipeline on the Brazilian Olist dataset, about 100,000 orders. Star schema in Postgres, dbt doing the modeling, Airflow running it daily, Kafka and Spark for a simulated live order stream. The repo is ecommerce-data-platform on my GitHub.
Two fact tables: fct_orders at order grain, fct_order_items at line-item grain. That split was the one decision that shaped everything downstream. Every question about basket size, revenue per order, or items per order depends on which fact you ask. Get the grain wrong and the query looks fine while the answer is wrong.
The mistake was dim_customers. In the raw data, one customer can have several customer_id values but only one customer_unique_id. I keyed the dimension off customer_id at first. Joins multiplied rows and my customer count came out about 30% too high. I did not notice until a simple sanity check on distinct customers did not match the source.
The fix was surrogate keys generated from customer_unique_id. Boring and mechanical. That is the whole point. Grain and keys are not modeling trivia. They decide whether every number downstream is right or quietly wrong, and nothing in dbt or Postgres will warn you. The tests I had covered uniqueness and foreign keys, which all passed. The data was still wrong.
Once the model was right, the marts actually answered things. Sao Paulo state is around 42% of all orders. Late deliveries averaged a 3.2 review score against 4.4 for on-time orders. The top 5 product categories produce roughly half of revenue while 70-plus categories share the rest. Only about 3% of customers ever buy a second time, so this is an acquisition business, not a retention one.
The other thing I learned: streaming took longer than the entire dbt modeling phase. Watermarks, late events, exactly-once semantics. Batch hides all of that from you, and it hides it well. The Kafka producer and Spark consumer were the hardest debugging sessions in the whole project, harder than the Airflow DAG or the dbt models.
If you are building your first star schema, pick the grain before you write a single model, and check your distinct counts against the source before you trust anything downstream.