Who are the people driving the design work in your shop? Here, all database design work is done by the application developers. In most cases, they have little or no experience with database design. Words like normalization, foreign keys, and indexes are concepts that they have never been introduced to in their line of work. That is not their fault. They did not show up to interview for their job and tell their future boss that they had such skills (and, for some, if they did do that, they should be ashamed for lying).

Having been a former developer I can remember more than one training class on building applications with some underlying technology. It did not matter what the platform, the point of the class was to show you how to build the application using their tools. It was not to spend time on building a proper database design. I can count on one hand the number of times I was in a class for application development and we spent time on database design…zero. If you want to learn those things, then you need to spend the time and money to take a different class. Besides, let the DBA figure out how to make things run better, right?

I have nothing against job security. I enjoy the fact that there is enough design work at my present company to keep a team of a hundred database administrators busy for the next ten years. I just hope my bosses see the value in keeping us around, even as we continue to sink under the volume of work that continues to pile up. But what I would like to see, and I imagine other database administrators around the world would like to see, are some changes be made to the application design structure currently being offered in classroom training.

First up, stop using ‘select *’ as an example for any query. As a matter of fact, go out of your way to spend two minutes explaining why ‘select *’ is one of the worst things you can send to the optimizer in MS SQL Server. This statement will force a full table scan, regardless of any indexes available, which can be a performance killer. It also makes for sloppy issues upstream and/or downstream if the underlying table structure changes. Too often I have seen system choke because columns suddenly appear (or disappear) overnight. A seemingly innocent change for one turns into a nightmare for others.

Second, explain to people that queries performed against the database server do not time out, they will run forever. If a person is working in an application (particularly a web application) and they get back a ‘query timeout’ issue, the query timed out due to a setting in IIS, and not the database server. In my opinion, no query should take more than three seconds and I understand that some need to take longer. I know that I do not want to be staring at a web page for a long period of time wondering if anything is happening, and three seconds is about the limit for most people’s patience. So, if you have written a query that takes longer than say twenty seconds, pick up the phone and call a DBA and ask for help tuning your query. Trust me, we live for stuff like that. And we are more than happy to teach you how to tune your own, which is a skill you can master over time.

Third, learn some basic security. Understand the difference between Windows Authentication and a SQL Server login. Understand the different database roles and fixed server roles, and when each should be used. Stop relying on the use of elevated permissions to do your development work, or start using different credentials when unit testing your application. Not having a basic understanding of these concepts leads to poor overall design as well as frustration when basic questions cannot be answered. For example, if you tell me that you are not able to login, and I ask “how are you trying to connect”, you should be able to give me an answer other than “I double-click to run the application from my desktop”. If you either built the application, or are responsible for its upkeep, then be prepared to explain how the application connects to the database and why it needs to be a member of any particular database role.

Lastly, do not allow people to teach application design classes unless they have an understanding of the three ideas listed above. Even if they tell their students to “consult a DBA before proceeding with your design” it would be a wonderful step. And in a pinch, if they do not know the answer, they can do exactly what we always do and lead with “it depends”.

“It depends, but check with your DBA before going so far that you do not want to come back.”

Would that be so hard to repeat a few times a day?