In my current job, dba’s and programmers are divided in tasks. Any code that needs to be written in procedures dba’s write, and programmers do only application code.
The strange thing is that whenever a task needs to be defined/specced, programmers get the task, and we have to define all the procedures needed and what they should return.
Is this a common practice in software development? Are programmers generally the ones tasked with building requirements for the database side?
Who else would you suggest should do it?
Think of it this way: Team A and team B work for the same company. If team A is required to provide an API for team B, who defines the requirements? Surely not Team A, without any knowledge of the application to be built on top of it. It must be team B.
Team A decides how to implement the API and they may insist on limitations for team B, but they cannot define what is required.
Does this change if the two teams are writing in different languages? No. So why should it change if team A is a DBA team?
8
I don’t think it is common practice for DBA’s to write stored procedures during the development of a program. Personnaly, I always had to write my own stored procedures, or sql code.
I think that since they know their database product much more than programmers (in theory, and at least it’s true for me), they are best used whenever something that needs more analysis needs to be done on the database:
- defining and optimizing table, tablespaces, indexes, etc.
- optimizing stored procedures
- database migration plan
- etc. (DBA’s, feel free to complete this list)
“Optimization” is the key I think.
A few years ago, I remember I asked my Oracle DBA about optimizing a procedure that was performing very poorly (like more than 10 seconds for only a few results). He came back to me with a request I did not understand at all containing keywords I’ve never seen before at that moment in time (INTERVAL
and how to use partitioning are extremely powerful when put at good use) and that was giving the same good results in less than 25ms…
As for programmers, they have to conceptualize the database, provide the scripts and work together with the DBA so that the resulting database schema is most efficient for the required tasks. Programmers and DBA’s should work together to identify/resolve bottlenecks occurring between the application and database servers.
4
Is it okay for programmers to be given the task of outlining database requirements?
If the programmers are the ones who need a certain procedure, table, trigger, or whatever in the database, then it makes sense for them to give requirements to the DBAs and have them actually do the work, especially if the programmers are not very proficient in whatever stored procedure language is being used.
In my experience, many programmers also write stored procedures because this particular system runs mostly within the database and there simply aren’t enough DBAs to go around. On the other hand, having the DBAs do the programming (or consult if they are too busy) can be a good thing as they may have insights on better ways to write performance-critical procedure code.