November 6, 2005
One table to contain all lookup data
Between the world of CRUDs and maintaining lookup data, programming for multiple tables can be painful, and in many causes does assist with performance at all.
So in some scenarios is maybe a good idea to contain all reference data within one single table, ie tblReference.
| refID | refMneumonic | refDescription | refType |
| 1 | AMS | Surgery | Service |
| 2 | ENDO | Endoscopy | Service |
| 3 | J | Ambulatory | PatientType |
| 4 | E | Emergency | PatientType |
| 5 | ET | EmergencyTemporary | PatientClass |
This design technique has a couple of advantages:
- First, it is very extensible when we come to the conclusion that we need to add a new type of reference data. Let’s say we just wanted to add the doctor numbers to this application.
- It is easier to maintain from a coding perspective. Imagine only one business model to handle all reference data with a gateway, bean, and DAO.
i fail to see exactly how extensible or easy-to-use this is, besides the fact that you 'might' have less code... even though I doubt the difference shd be anything significant
it also appears you are structuring your data to fit your code; imho, it shd be other way around... what this means is that, when minor things in your code change, you don't have to make changes to your data to make that fit too... as an example what happens when "Service" becomes "SVC"... hyphotetical, but possible :) ... before long, you'll start maintaining a reference table for reference types ... :P
there's value in keeping your code/data model as separate and as simple as possible :)
I'm beginning to think that this approach is more popular than I would have thought. It seems like it would go against everything I know to mix all the different types of data, but I see it more and more in larger applications. I see you are using medical terms and the last place I saw this was in the Cerner Millennium system. Do you think there are performance gains as well to storing reference data in a single table?
Posted by: Steve House at November 7, 2005 7:43 AMHi Elyse,
I don't mean to be negative, but I think this style of DB design has flaws. It only works as long as the different types of "reference data" have the same taxonomy - in this case, a Mneumonic and a description.
1. What happens when I want to store State and Country data in the catch-all lookup table? Or ZIP codes, with lat and long info?
2. It sort of defeats the purpose of normalization to some degree - you wind up with a ton of duplicate strings in the "type" column. To fix this, you can add another table refLookupType, but then...when not just use real, entity-dedicated tables to begin with at that point?
I've been down the road with a very large application that did just what you're describing - the table became a mess, had tons of columns to hold entity-specific stuff, sometimes the columns held something nothing like what they were named because "we can just use this column for that," etc.
Posted by: Joe Rinehart at November 7, 2005 9:56 AMI did the same thing 4 years ago to combat massive proliferation of lookups. I now have a 2,500 row lookuptable and this table contains the list of lookups as well (set refType='Valids' and refMnumonic='age_class' and refDecsription='Age Classes'. Then refType for the actual age classes is set to 'age_class' - So the code also maintains the list of lists. Also added a definition column and a flag to show or hide a row. My code can also handle addng the next sequence to a valids list - the refMneumonic may be numeric and not alpha-coded. Only have to be careful about deletes and refMnumonic changes
Posted by: Dave Watts at November 7, 2005 6:12 PMFinally passed the test
Managing in light of McGregor's Theory X and Theory Y
CMMI
Kicking HIT Leadership Up a Notch
That's just some mumbo jumbo project management BS
Outcomes - The tactic to get to the strategy
Nurse Call, VOIP, and Wi-Fi: Its just cool when things come together!
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
December 2006
November 2006
August 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
November 2005
October 2005
September 2005
August 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
December 2003
November 2003
October 2003
Joel on Software
David Ross
Edward Prevost
Martin Fowler
The Health Care Blog
The Tales of Hoffman
The Business Word
Medical Rants
Christina's Considerations
Paul Levy
HIS Talk
Appropriate IT
Candid CIO
RSS feed




