The FACT is that it is not so DIM after all

I have always looked down upon the Fact and Dim prefixes applied to the tables within the AdventureWorksDW database with derision. "Why," I asked myself, "would anyone feel the need to use such prefixes? Clearly this is BI for dummies." Given that most BI projects use a nice clean, dedicated data warehouse database where all the tables are imported into the cube, perhaps my derision was justified.

However, in my current project I have been building a near-real-time OLAP solution directly on top of an application database. Of course, to isolate the cube from potential schema changes, I created an abstraction layer in the form of a set of views. However, as the project has progressed and the large team of developers has created more and more database objects, it has become increasingly difficult to find the views created for the cube among the debris.

I recently had to re-build the entire cube from scratch due to a bug caused by reverting to a previous version in source control. Of course, I took the opportunity to consolidate all my T-SQL code into a few files and adopt a consistent naming convention for all my views. So what naming convention did I adopt? Well Fact and Dim of course! Why? Well because anyone following on from my work who is half-familiar with the BI sample databases will immediately recognise the relevance.

I subsequently found out the big benefit of adopting this convention – it makes creating a DSV much, much easier! A quick search for all objects containing 'Fact' and 'Dim' soon had my new DSV populated with all the relevant objects.

So the Fact is that this practice is not so Dim after all!

Published 22 April 2008 06:13 by DrJohn
Filed under:

Comments

22 April 2008 11:09 by Piotr Rodak

# re: The FACT is that it is not so DIM after all

So, you discovered 'hungarian' notation for databases? ;)

This is what many people flame about, and I still find it easier to organize objects if they have meaningful prefixes. Oldskul you may call it.:)

I think that using separate schema for the interface might be also a good idea.

Regards

Piotr

02 May 2008 11:20 by DrJohn

# re: The FACT is that it is not so DIM after all

Thanks Piotr, I am a great fan of prefixes and acurate naming.  Using a seperate schema for the cube is a great idea and exactly what I initially proposed.  However, the dev team are using CodeSmith to generate their code and they tell me the tool only supports the dbo schema.  Clearly my views should affect thier work, but they insisted on a single schema.  Shame.