You are not logged in.

#1 2009-06-20 10:43:40

Diospyros
Member
Registered: 2009-03-15
Posts: 57

[Solved] Database design question

I'm trying to create a web application that makes use of a database to track user information.  I have some experience using databases, but none in schema design.  My question:  Is it better to split information up in many tables or to have as much data in a single table as possible?

Use case:  Each user has a profile page where they can enter information, post content, etc.  so I'm trying to decide whether to have a single table with user name, encrypted password, birth date, and all the profile information (probably a bunch of text blurbs), or whether to split it up into a user information table and a profile information table.  Which would be better in terms of performance?

Last edited by Diospyros (2009-06-20 21:25:29)

Offline

#2 2009-06-20 12:59:29

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: [Solved] Database design question

the google search keywords you want are 'data normalization'. Basically, try to design your tables so there's no duplicate columns, and no duplicate information between rows. But don't go overboard because too many joins can be expensive.

Dusty

Offline

#3 2009-06-20 13:05:51

oxeleo
Member
Registered: 2009-04-25
Posts: 5

Re: [Solved] Database design question

Generally it's better to use less tables. Unless you have one-to-many relationship I suggest you use one table and leave null if some field is empty.

Offline

#4 2009-06-20 13:49:17

Ramses de Norre
Member
From: Leuven - Belgium
Registered: 2007-03-27
Posts: 1,289

Re: [Solved] Database design question

If the database is supposed to be a long term solution with many entries, I think you should decently normalize your schema. As said before look into schema normalisation and head for at least a 3NF design, possibly BCNF if that's possible without causing problems.

Offline

#5 2009-06-20 21:23:46

Diospyros
Member
Registered: 2009-03-15
Posts: 57

Re: [Solved] Database design question

Alright thanks everyone!

I found a couple of good resources for basic understanding, links for anyone stumbling on this page later:

http://en.csharp-online.net/Relational_ … malization
http://www.datamodel.org/NormalizationRules.html

Offline

Board footer

Powered by FluxBB