views:

449

answers:

5

How is database design different from program design?

A: 

Errr, seriously?

The premises are entirely different. Database design is more concerned about the efficiency of data storage and retrieval. Program design, on the other hand, is more concerned about efficiency in execution.

Of course if you want us to go into further detail, you could provide some more detail as to why you're asking this in the first place. ;)

Jon Limjap
Probably not seriously, probably homework.
S.Lott
Program Design should not be "... more concerned about efficiency in execution". It should be about:(1) ease of use, (2) ease of change
Mitch Wheat
A: 

Database is your persistence layer. Program is your business layer.

For example: when you look at this stackoverflow page, you see question/answers, on right side some statistics and some related questions. This is business layer.

Sure, you could just persist whole view (business layer), but it wouldn't be very efficient. For example on the right side, there is a tag count. It says that 732x was asked question with tag "database". Now when someone will ask new question, if you persist business layer as it is, you would need to increment counter in every single view. You could do that but it's very error-prone (in more complex scenarios) and inefficient.

So what we normally do is, that we come up with the way for most efficient & simplest persistence of our program and the result is database design.

lubos hasko
A: 

I would say database design is basically the design of the data storage. The program design is the design of the functionality. There is some cross over as the database can have some functionality built in as well.

Craig
+3  A: 

If we are talking relational dataabase design, it has mathematic roots and can be distilled down to very simple normalization rules. While you may break those rules for performance or ease of querying due to some inadequacy of SQL in living up to the true ideals of relational theory, they are set rules and you can know quite obviously when you are breaking them.

Program design is much more artistic and free form. Even if you use code metrics, the rules are much more flexible.

jezell
A: 

One major difference between program design and database design - most database designs, anyway - is that the database will be used by multiple applications (programs), and will often continue to be used after current programs have been forgotten. Hacks perpetrated in a single program don't usually affect other programs; hacks perpetrated in a database can affect all the programs that access the database. So, database design has to take a broader view of life than just a single program design.

One of the problems with the average object DBMS (or, more accurately, the databases designed using the average object DBMS) is that it organizes the data in a way that is great for one particular program - the first that's written to use it - but it often is extremely difficult to adapt other programs to use the database structure that made perfect sense for the original program.

Jonathan Leffler
I wouldn't say most databases are used across multiple applications. In enterprise development this is often the case (not always), but outside of enterprise development it is normally not the case.
Craig
You had me until "one of the problems with the average DBMS". A DBMS is designed to be used by multiple users and applications, that's why people bother to use them.
Seun Osewa
@Seun Osewa: I said "average object DBMS", not "average DBMS". I may be misinterpreting OODBMS, but often the designs are optimized for one application, and work OK for similar applications with similar requirements, but are horrid for applications with different requirements for the same data.
Jonathan Leffler