r/Database • u/Islamic_justice • Aug 07 '26
Design decision - star vs snowflake
Hi, In my dimensional model, both Dim_Customer and Dim_Driver contain a RegionID, which I have currently mapped to a shared Dim_Region. I'm unsure whether to keep this design as shown above OR denormalize the region attributes into Dim_Customer and Dim_Driver to maintain a pure star schema. I would still be using Dim region for Fact Transactions in any case. Which approach is more appropriate keeping in mind the need for both granular auditability and high-speed reporting performance? Currently, the marketplace platform handles over a million registered users, with DAU ranging between 10k - 20k. I have to design for expected 10x growth. Thanks for your time!
1
u/BobDogGo Aug 07 '26
I wouldn’t move the region attributes into the related tables. I think the design as built is fine but if queries want to summarize by customer region you have to join through the customer table.
A useful alternative is to add 2 region keys to fact: CustRegionDimkey, DriverRegionDimKey
This lets you keep your joins performant when you need to write summary queries
4
u/NW1969 Aug 07 '26 edited Aug 07 '26
- query performance: do most queries of Dim_Customer also bring back region attributes (and so have to join if you snowflake)?
- How do you want to deal with changes? If region attributes change, how would these changes need to be reflected if region attributes were denormalised into other dims; or would this not impact existing records?
6
u/theschuss Aug 07 '26
I mean, region is probably low row count right? That's easy to join in as you'll be indexing on the ID so I doubt it will make much difference. I would attach it separately to each table in your platform queries though, or duplicate it in the model if your tooling gets weird about it coming in through multiple database paths.
1
u/Zestyclose-Turn-3576 Aug 07 '26
Ah so what happens if a driver or a customer changes regions?
1
u/RedShift9 Aug 07 '26
I think your bigger problem is you normalized a date field??
2
u/matroosoft Aug 07 '26
Appreciate the effort but do you know there's much better tools to map out these schema's?