| | |
Which is better? Tons of separate tables with a little data or one big table?
Please support our MySQL advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
I'm working on a web app in which each user will have their own account. Each account would have its own data (duh) and this data needs to be kept separate from everyone else (either by putting it in another database JUST for that user or combining all data into 1 database and then marking it with a "userid" that can be used to filter out every one else stuff.
Which would be better: having a different database for every user (created on signup via sql and php) that is named after their userid? Or is it better to combine all of the info into one massive database and just earmark things with an indexed "userid"?
Thanks
Performance might be an issue in the future so which is better for that?
Which would be better: having a different database for every user (created on signup via sql and php) that is named after their userid? Or is it better to combine all of the info into one massive database and just earmark things with an indexed "userid"?
Thanks

Performance might be an issue in the future so which is better for that?
Last edited by igeek; Nov 24th, 2008 at 8:03 pm.
I <3 Apple.
•
•
Join Date: Aug 2008
Posts: 1,160
Reputation:
Solved Threads: 137
Re: Which is better? Tons of separate tables with a little data or one big table?
0
#2 Nov 24th, 2008
i don't think speed is necessarily going to be an issue, just be sure to make fk and primary keys, and indexes where necessary and you should be good using a single db
on top of that, it would be a nightmare for multiple databases, multiple upgrade scripts, i would most likely advise against it unless its truly a distributed application
on top of that, it would be a nightmare for multiple databases, multiple upgrade scripts, i would most likely advise against it unless its truly a distributed application
Custom Application & Software Development
www.houseshark.net
www.houseshark.net
Re: Which is better? Tons of separate tables with a little data or one big table?
0
#3 Nov 24th, 2008
Thanks for the reply. Yeah, I had considered that upgrading the app later might be a nightmare trying to process 1,000 different databases rather than changing just 1 big one (or at least it would be somewhat resource-intensive)
If I did a bunch of different databases (one for each account) then each database would also have a unique mysql user/pass. I was thinking it might be more secure so that each account can only access THEIR data in THEIR database rather than all data (using permissions). If someone could somehow find a way to hack in and get the universal msyql username/pass then I'm screwed b/c everything is in 1 place.
But using unique dbs and user accts, in order to hack into all data a person would have to get ALL the usernames/passwords which would be near-impossible.
Again, I really appreciate feedback
If I did a bunch of different databases (one for each account) then each database would also have a unique mysql user/pass. I was thinking it might be more secure so that each account can only access THEIR data in THEIR database rather than all data (using permissions). If someone could somehow find a way to hack in and get the universal msyql username/pass then I'm screwed b/c everything is in 1 place.
But using unique dbs and user accts, in order to hack into all data a person would have to get ALL the usernames/passwords which would be near-impossible.
Again, I really appreciate feedback
I <3 Apple.
•
•
Join Date: Aug 2008
Posts: 1,160
Reputation:
Solved Threads: 137
Re: Which is better? Tons of separate tables with a little data or one big table?
0
#4 Nov 24th, 2008
you can specify sql user accounts and ip addresses if need be
Custom Application & Software Development
www.houseshark.net
www.houseshark.net
Re: Which is better? Tons of separate tables with a little data or one big table?
1
#5 Nov 25th, 2008
Someone once posted the analogy that a different database for every record is like a different hard drive for every file.
![]() |
Similar Threads
- make css apply to a chunk of html (HTML and CSS)
Other Threads in the MySQL Forum
- Previous Thread: Count Comments?
- Next Thread: Pulling related data from relational dB re: thread: Problems with a many-to-many inse
| Thread Tools | Search this Thread |
agplv3 alfresco amazon api artisticlicense aws bizspark breathalyzer camparingtocolumns changingprices cmg communityjournalism contentmanagement contractors copyright count court crm database design developer development distinct drupal dui ec2 email enterprise eudora facebook form foss gartner gnu government gpl greenit groklaw groupware hiring hyperic images innerjoins ip joebrockmeier join journalism keyword keywords kickfire laptop law legal license licensing linux maintenance managing mariadb matchingcolumns metron micromanage microsoft microsoftexchange mindtouch montywidenius mozilla multiple music mysql mysqlcolumnupdating mysqldatetimeordermax() mysqlindex mysqlinternalqueries mysqlquery mysqlsearch news open-xchange opendatabasealliance opengovernment opensource penelope php priceupdating query referencedesign reorderingcolumns resultset saas select sharepoint simpledb sourcecode spotify sql syntax techsupport thunderbird transparency virtualization






