Jump to content

Many small databases, or one big? (MySQL)


Norsk.Firefox

Recommended Posts

Hello

Have a question for a portal I'm developing now. Is it better with one big database with a lot of fields, or some few with fewer fields?

 

Example:

Table users:

- UserID

- Username

- Email

- Zip

- Password

- And some more

 

And then a table witch has one row for every user:

Table settings

- UserID

- ShowMail

- Show Zip

 

Is it better with two, one combined or is it up to the rest of the code?

 

- NF

Link to comment
https://forums.phpfreaks.com/topic/102694-many-small-databases-or-one-big-mysql/
Share on other sites

Depending on the amount of data you have, two (or more) tables would be better.  Take a site like MySpace or Facebook -- all that profile information is stored on multiple tables.  The two questions to ask are: 1) How much data are you storing, and 2) Will you querying them separately more often than together?

 

What I mean is, will you be having the username and whatnot at the top of every page, and only display the profile information in a single profile page?  If yes, then try separating them.  But again, if you're only added a few minor columns to the table, might as well keep them one.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.