Click to See Complete Forum and Search --> : Quick question on database design.


Pembar
07-02-2009, 04:51 AM
Hello guys,

I just have a few quick questions about a website I'm about to be putting together.

1. Is it common to put everything about a user into a single database (mysql) table? Or do you have just one for login purposes and store the rest of the user's information in separate tables?

2. How do you design for something which have "infinite size", blog entries for example. Do you store this in a database as well? I might have to store text files / or text strings of roughly 10,000 chars in length.

Thank you so much.

Regards,
Pembar

TheBearMay
07-02-2009, 10:19 AM
#1 - Depends on what you mean by everything, and what the other design considerations are; i.e. is there a security need that would require the data to be split, is there a report issue that is solved or exasperated by placing the information in a single table, does a row size limit come into play, etc.

#2 - VarChar in MySQL 5.03 permits up to 65,535 characters (note that the entire row also has a limit of 65,535 so you really can't use the maximum column size and have it link to anything).

brunoais
07-07-2009, 04:49 AM
about the 2:
there's also bigtext. If are only going to save and load info the text type is the most apropriate as it's faster, takes less space and can have more info. I hadn't found yet the limit for bigtext
If you instead want to compare or store variables (for the sql to verify, etc...) you'll need varchar.