Av rating:
Total votes: 31
Total comments: 11


Phil Factor
The Joy of NAD
30 October 2007

The Scene: A meeting room in the IT department of a large company in London. The meeting is in its third hour and the participants lie slumped in their chairs, like discarded puppets. The walls are covered with crumpled ER diagrams full of boxes and crow's-foot arrows. An air of doom permeates.

Phil Factor
(fending off black despair) Right. It looks as if we can't agree on the data architecture for the trickier parts of the new application, such as the back office functionality. Let's take a step back and do something easy. What about looking at the NAD side of the application (Ed: NAD=Name and Address). This'll be nice and simple, hopefully. (Thinks: if I can catch the early train, there's that nice pub in Aldeburgh….)

(Developers look up from their notebooks and stare bleakly at Phil)

Phil
(with strained enthusiasm) Well, how about a nice simple table with the customer's name, phone number and contact address in it?
Dan the Data Man:
Wait a second, I can see problems already. People can run accounts under different names. Single customers will have many names.
Developer:
Surely, we can just tell them they can't have more than one name?
Phil Factor:
(Thinks: ...and people wonder why we are reluctant to let the developers out of their cubicles)
Dan the Data Man:
(patiently) It is perfectly reasonable for our customers to have accounts under several different names. Disallowing this might even be seen as discriminatory but in any event it would certainly be inefficient. If we treated them all as different customers we'd end up phoning or visiting them several times in a row. It happens occasionally and we know that our customers don't like it. And besides, this is real life – a married lady can use her own surname or her husbands, and even call herself something like 'Mrs Phil Factor'.
Developer:
(attempting humour) But that could also mean that Phil has had a sex change?
Phil Factor:
I say, dash it chaps!
Dan the Data Man:
Ah, quite. You've identified another issue. Oh dear, the complications whenever that happens. Sex changes are date-related so that if we print out transactions before the sex change they'd have to be Mr Phil Factor, and after the date they'd be Ms Philippa Factor.
Developer:
OK. So we'll have to put the names in a different table and have a many-to-many relationship with the Customer table
Alan Analyst:
The application developers will never understand the SQL for the CRUD (Ed: Create, Read, Update and Delete). Their embedded code will cause havoc and the DBAs will demand an interface based on stored procedures.
Phil:
(to himself) Yes!!! Result!!!
Dan the Data Man:
You want to store contact addresses too? (Sucks through teeth and shakes his head sorrowfully).We'd need to record all of the addresses associated with each customer. What about billing addresses, Bankcard addresses, work addresses and so on?
Dan the Data Man:
Are we recording the customers' contact numbers as well?
Phil Factor:
Of course. Sales have put in the requirement and it would seem a good idea to recognise the CLI (Ed: Caller's phone number) when a customer phones into the telephone banking system….
Dan the Data Man:
A customer will have a home phone-number, a work number, a mobile number and so on, some of which will be current and others which will have expired at a certain date. This means that we'll have to record the type and termination date of each entry.
Phil Factor:
(with a pathetic attempt at bringing the meeting to a close before his train goes) Well, is there any way we can let the code-jockeys create their own Customer object and just 'persist it' (Ed: store it) as XML in the database?

(Various developers bob up and down in their seats with excitement)

Dan the Data Man:
The last time we did that, it was pandemonium. We ended up with six mutually exclusive definitions of what a customer was and none of them recognisable by the business.
Derek DBA:
(between clenched teeth) …and no ordinary mortal could maintain the production system when it finally emerged.

(Developers relapse into surly quiescence)

Developer:
Yes…so we'll have to put the contact numbers in a different table and have a many-to-many relationship with the Customer table The linking table will need the date stamp and the type of contact number (thinks: is this Groundhog Day?)
Alan Analyst:
Well, also, marketing want a whole lot of other customer details stored, so they can work out the demographic profile of purchasers. They're dead keen but rather unclear as to what these details will be.
All:
'One True Lookup Table'!
Phil Factor:
OK! OK! So someone think of a better way of making changes to an entity on a production server without needing to do any change management procedures? We're going to need an EAV (Ed: Entity Attribute Value) table just to bridge the gap between marketing and reality, by allowing 'soft attributes'.
Dan the Data Man:
We generally find that marketing have very short memories anyway, so we can time-bomb the additional 'soft' attributes. We call it the 'Goldfish' mechanism..
Phil Factor:
Excellent! We seem to have a broad agreement on the general principles of the design. There's no sense in getting into to much detail at this stage. (Thinks, if I run part of the way to Liverpool Street station, I'll get that train)
Colin Compliance:
(clears throat) I'm a bit concerned about the auditability of this NAD.
Phil Factor:
(Thinks: Two million years of human evolution just to get a Compliance officer! Nature can be cruel. It doesn't seem right)
Colin Compliance:
This design isn't going to get sign-off by the audit-compliance team. Do you realise that we have to be able to reproduce invoices, advice notes, returns and such paperwork exactly as first done? We have to audit when an address changes. Any change of name has to be logged with date, time, the database user and workstation. There have been many frauds in the past that have involved changing a customer's address, so the audit-compliance team will have a feeding-frenzy on the design as it is so far.
Phil Factor:
(thinks: OK, next train in an hour's time. Might as well spread the anguish) Good thinking, Colin. So that means we'll definitely need to have all CRUD done via stored procedures, with a separate log for all changes.

(Developers slump, despondent)

Colin Compliance:
(warming to the subject) Yes, the design will have to have a full audit trail. We will need to make all tables time-based so that all versions are kept, with an insertion-Date and termination-date, and the SQL picks out the current one only due to its null termination-date. We'll need a trigger to enforce the rule of having only one record with a null termination-date where one would otherwise have a unique constraint. We can then cross-check it with the separate audit log.

Phil Factor:
(recovering from a near-death experience) Quite so, some interesting ideas there.
Derek DBA:
Someone is going to ask for an independent Data Protection audit report on how we conform to the Data Protection Act. Marketing always sail close to the wind. Maybe we'll need to encrypt some fields, over and above the usual security precautions.
Dan the Data Man:
Security issues aside, we'll probably need to allow customers to check all data we hold on them for accuracy. Has anyone studied the Freedom of information act and the Human Rights Act for compliance issues?
Colin Compliance:
Yes, and we haven't even started discussing Sarbanes-Oxley, FSA, HIPAA, HSPD-12, BASEL II, SEC, FSA, FASB (Financial Accounting Standards Board) and Gramm-Leach-Bliley…
Phil Factor:
(Thinks: I have an hour to kill, a concealed iPod and a thirst for revenge) Yes, I think we should bottom out all these fascinating compliance issues first and then move on to identify any potential performance concerns. But regrettably we must be brief, as the room is only booked for the next fifty minutes.


This article has been viewed 3672 times.
Phil Factor

Author profile: Phil Factor

Phil Factor (real name withheld to protect the guilty), aka Database Mole, has 20 years of experience with database-intensive applications. Despite having once been shouted at by a furious Bill Gates at an exhibition in the early 1980s, he has remained resolutely anonymous throughout his career.

Search for other articles by Phil Factor

Rate this article:   Avg rating: from a total of 31 votes.


Poor

OK

Good

Great

Must read
 
Have Your Say
Do you have an opinion on this article? Then add your comment below:
You must be logged in to post to this forum

Click here to log in.


Subject: Amusing, as Always
Posted by: GSquared (view profile)
Posted on: Tuesday, October 30, 2007 at 8:52 AM
Message: Yes, simple things can end up being quite complex when you actually start to get into all the conflicting needs.

To add another level of complexity to all of it, what if you ask if the data changes can be logged to a WORM drive for auditing purposes? Getting that up and running can be worth several meetings all by itself! (It works, and helps in SOX, but what to log and how can cause all kinds of fun arguments.)

Subject: Good Grief!
Posted by: Ian Logan (view profile)
Posted on: Wednesday, October 31, 2007 at 11:27 AM
Message: Is this how all those government contracts have failed??

Subject: Better Grief!
Posted by: Paker (view profile)
Posted on: Wednesday, October 31, 2007 at 1:49 PM
Message: Not just government contracts - plenty of private sector work goes 'toes up' over just these concerns.

Subject: Brilliant but Incomplete
Posted by: Alex Fekken (not signed in)
Posted on: Wednesday, October 31, 2007 at 7:35 PM
Message: Sad to see that you have neglected the issue of address structure ;-)
As you know the properly normalised structure of an address is country-dependent. For example, in The Netherlands the postcode and street number are enough to determine the street name and town/suburb. And of course the structure should allow you to properly format an address label from its constituent pieces (street number before or after street name etc).

Subject: Brilliant but Incomplete
Posted by: Alex Fekken (not signed in)
Posted on: Wednesday, October 31, 2007 at 7:43 PM
Message: Sad to see that you have neglected the issue of address structure ;-)
As you know the properly normalised structure of an address is country-dependent. For example, in The Netherlands the postcode and street number are enough to determine the street name and town/suburb. And of course the structure should allow you to properly format an address label from its constituent pieces (street number before or after street name etc).

Subject: Brilliant Grief!
Posted by: Anonymous (not signed in)
Posted on: Thursday, November 01, 2007 at 3:20 AM
Message: Not just IT.
How about a four hour 'discussion' with twenty-plus (self-invited) participants arguing over the positioning of one switch in the cockpit of TSR-2?
ANY project considered politically juicy will attract career vampires with nothing to contribute but time (for which they are invariably being paid a lot more than you..).

Subject: Re Brilliant but incomplete
Posted by: Phil Factor (view profile)
Posted on: Thursday, November 01, 2007 at 7:15 AM
Message: Yes. One one of these projects, we had just finally gained consensus and got all the design signed off when someone noticed that we had forgotten to make the system multilingual. Aiee! England no longer just speaks english.

Subject: Umm...
Posted by: jtklopcic (view profile)
Posted on: Thursday, November 01, 2007 at 10:36 AM
Message: I thought it was supposed to be funny. This was just another day in the office.

Subject: Umm...
Posted by: jtklopcic (view profile)
Posted on: Thursday, November 01, 2007 at 10:51 AM
Message: I thought it was supposed to be funny. This was just another day in the office.

Subject: Another day in the office
Posted by: Davo (not signed in)
Posted on: Thursday, November 01, 2007 at 9:52 PM
Message: Also need to consider the flow on to associated CRM databases, compliance with courier and delivery services, training and customer service, getting it past the steering committee etc. as fro marketing it isn't so much that they forget, they just chnage their minds, new requirements that range from a tweak to a complete re-write, then there's the 2 cents worth from "upper management guy" who has an interest in the 11th hour and all of a sudden everything changes. What about international time zone and daylight savings compliance localisation, although this probably doesn't apply. Also which countries are you going to include, 192, 193, 194 - make a pick - do you want to include them all? to what level is your address validation going to go to and if you include this how are you going to scrub out the existing data in your CRM?
AAAAAAAAAAAAAAGGGGHHH!!

Subject: Punch line ?
Posted by: orcus (view profile)
Posted on: Sunday, November 11, 2007 at 4:44 PM
Message: Maybe the punch line is next week when somebody mentions legacy integration or publishing in existing record formats.

And it all gets tied up in a medieval discussion of data types, record formats and sequences.

 

















Level Playing Field
 The Federal Government in the States accepts tenders for their IT projects from a wide-range of... Read more...

Women in IT: Change at Every Level
 In the past, straight-forward sexism was a real problem in the IT industry – women in IT were... Read more...

Second Life: A Virtual World of Real Money
 As more and more people invest in alter egos to live a pseudo life online in Linden Labs' latest... Read more...

Ross Anderson: Geek of the Week
 Professor Ross Anderson is one of the foremost experts in Computer Security in the world. He has... Read more...

Andrew Tanenbaum: Geek of the Week
 Andrew Tanenbaum has had an immense influence on the way that operating systems are designed. He... Read more...

Linus Torvalds, Geek of the Week
 Linus Torvalds is remarkable, not only for being the technical genius who wrote Linux, but for then... Read more...

Driving up software quality - the role of the tester
 Have you ever wondered what a software tester does? Helen Joyce, test engineer at Red Gate software... Read more...

Coming Out as a Cancer Survivor - A Guide for Software Developers
 A personal perspective on the responsibilities of a cancer-surviving software developer Read more...

The Computer that Swore
 Database Developers occasionally get crazy ideas into their heads. Phil Factor should know; He... Read more...

The Writing on the Wall
 Phil Factor offers an intriguing theory on why so many, hugely complex, government IT projects fail. Is... Read more...

Over 150,000 Microsoft professionals subscribe to the Simple-Talk technical journal. Join today, it's fast, simple, free and secure.

Join Simple Talk