Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Looking for some opinions (mysql/php websites)
Old 04-01-2008, 10:47 PM Looking for some opinions (mysql/php websites)
Average Talker

Posts: 26
Name: Carl
Trades: 0
I'm looking for an opinion.

I have 5 websites that all run on php/mysql.

They all have very similar database tables (most of them are exactly the same).

Which option would you choose and why?

1. Each site has it's own database

2. All sites use the same database and each table would have a sitename column which tells you to which site the row belongs.

Looking forward to your opinions.
__________________

Please login or register to view this content. Registration is FREE
carlg is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-01-2008, 11:03 PM Re: Looking for some opinions (mysql/php websites)
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
All though you could do either, it does not give you any more benifit to share the same database unless you want an easier way to share same data content. The downside to that is the possible chance to have a very large database that will be more difficult to backup, restore, maintain, etc.
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Old 04-02-2008, 01:14 AM Re: Looking for some opinions (mysql/php websites)
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
Graphic, what do you mean with "very large"? mysqldump does not bother even if your db size is 10G.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 04-02-2008, 03:23 AM Re: Looking for some opinions (mysql/php websites)
mork29's Avatar
Extreme Talker

Posts: 242
Name: Keith Yelnick
Trades: 0
Quote:
Originally Posted by carlg View Post
2. All sites use the same database and each table would have a sitename column which tells you to which site the row belongs.
That would only be neccessary if tables were shared between sites. The more common practice for this would be to prefix your table names with the same thing for each site, example table names:

site1_users
site1_products
site1_stuff
site2_users
site2_products
site2_whatever
mork29 is offline
Reply With Quote
View Public Profile
 
Old 04-02-2008, 03:52 AM Re: Looking for some opinions (mysql/php websites)
vectorialpx's Avatar
Extreme Talker

Posts: 249
Name: octavian
Location: Bucharest
Trades: 0
Each site has it's own database - is more faster and more better for the mysql server...
__________________
you can
Please login or register to view this content. Registration is FREE
vectorialpx is offline
Reply With Quote
View Public Profile Visit vectorialpx's homepage!
 
Old 04-02-2008, 12:20 PM Re: Looking for some opinions (mysql/php websites)
rogem002's Avatar
PHP Chap

Posts: 843
Name: Mike
Location: United Kingdom
Trades: 0
"Each site has it's own database" is the best option, imagination if a hacker was annoyed at your website and decided they wanted to attack the database. If they did get in, they only take out one website
__________________
My Blog/Site:
Please login or register to view this content. Registration is FREE
rogem002 is offline
Reply With Quote
View Public Profile Visit rogem002's homepage!
 
Old 04-03-2008, 12:33 AM Re: Looking for some opinions (mysql/php websites)
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
How many times your databases were hacked? How many people do you know who's databases were hacked? Talking about hacking databases you should always remember that it takes time and efforts to hack anything and it will only be done if the data inside is valueable enough to spend time and efforts on it. Hacking just for fun usually (in 99% cases) means that website developer or db administrator or somebody else was too stupid to setup database access privileges properly. And obviously it cannot be called "hack" when some account has 123 or qwerty as password or no password at all.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 04-03-2008, 12:36 AM Re: Looking for some opinions (mysql/php websites)
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
Quote:
Originally Posted by vectorialpx View Post
Each site has it's own database - is more faster and more better for the mysql server...
Do you still run your webserver on P-III 500MHz with 64M RAM?
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 04-03-2008, 12:12 PM Re: Looking for some opinions (mysql/php websites)
vectorialpx's Avatar
Extreme Talker

Posts: 249
Name: octavian
Location: Bucharest
Trades: 0
at 3000 visitors per day and 12000 records you can have a PVIII
and, it depend of the project... at 30 users per day and 1000 records you can make 8 sites in one database... not just 2 but you must think, it you get something to work you need more than that and big sites have more than 2 databases for one project [security, usability and... it's faster]

and, the security problem remains
__________________
you can
Please login or register to view this content. Registration is FREE
vectorialpx is offline
Reply With Quote
View Public Profile Visit vectorialpx's homepage!
 
Old 04-05-2008, 01:02 AM Re: Looking for some opinions (mysql/php websites)
Ultra Talker

Posts: 310
Trades: 0
I think it would be better to keep databases separate for each site unless you want to share content . First of all it is logical. Second, lets say due to a bug in code of one of your websites, you managed to corrupt records for one of your website, imagine the efforts you'd have to put to restore the correct for that particular site. What if in future you decide to change the way the data is stord for a particular site, again you'd have to put unneccssary extra effort. Also, what's the need to add an extra lookup (even if it is based on an index), when you can easily avoid it.
dman_2007 is offline
Reply With Quote
View Public Profile
 
Old 04-05-2008, 04:22 AM Re: Looking for some opinions (mysql/php websites)
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
I would choose "Each site has it's own database" for these reasons:

1) Less data for the MySQL engine to have to sift through to compose a page, thereby increasing maximum load speed.

2) If customizations are made to a specific site, one does not necessarily have to consider the effect on any other site.

3) Sites which do not store data that is used in other sites would have blank data in the table, thereby wasting space with virtually no gain.

4) Data which is used for statistical calculations could be stored in a table with the same structure so that data could be exported from the live server, recomposed on a data mining server, and then queried using MERGE table so that data mining does not impact the live server and during the data mining process, only necessary data is parsed.

5) If you have to move one site to another server (due to excessive bandwidth usage, for example), then such move does not need to consider the other sites and unnecessary data does not also have to be moved in order to maintain your functional structure.
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 04-07-2008, 12:17 PM Re: Looking for some opinions (mysql/php websites)
dansgalaxy's Avatar
Defies a Status

Posts: 6,521
Name: Dan
Location: Swindon
Trades: 0
I have to agree with the above, keep them seperate unless you want to share anything, so if you wanted to have the user system shared then it might be okay to do it else no point.
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Old 04-07-2008, 08:06 PM Re: Looking for some opinions (mysql/php websites)
Novice Talker

Posts: 7
Trades: 0
I agree with the two above.
GallaUK is offline
Reply With Quote
View Public Profile Visit GallaUK's homepage!
 
Old 04-08-2008, 05:31 PM Re: Looking for some opinions (mysql/php websites)
Novice Talker

Posts: 11
Name: Tortoise
Trades: 0
I'd go with different databases, unless the sites are more-or-less exactly the same.
Tortoise is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Looking for some opinions (mysql/php websites)
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.23677 seconds with 12 queries