Computing.Net > Forums > Web Development > Question about shared database

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Question about shared database

Reply to Message Icon

Name: bbmak
Date: June 8, 2005 at 17:29:45 Pacific
OS: Linux
CPU/Ram: 4.0/1024
Comment:

Right now I have a website written in php, and the website is using mysql database, but my website has so many traffic everyday. I want to know if i can set up another website, but it is using the same database

here is what i want

Website 1 Website 2
\ /
Mysql database

Are there anyway i can do that?



Sponsored Link
Ads by Google

Response Number 1
Name: SN
Date: June 8, 2005 at 17:59:22 Pacific
Reply:

Sure, you can do that...just setup both servers and change the php appropriately (if needed) to connect to the same db...

The problem is that chances are pretty good the database load is more of a performance consideration than the webserver load, so your solution is likely backwards.

Good luck,
-SN


0

Response Number 2
Name: bbmak
Date: June 8, 2005 at 18:16:37 Pacific
Reply:

how do I do the backward?
2 shared mysql database?


0

Response Number 3
Name: SN
Date: June 8, 2005 at 19:13:20 Pacific
Reply:

There are any number of ways, varying in complexity. On the php side, you just need two database servers and some code in the PHP to determine which one of the two you should connect to that makes it about even. A simple solution would be to choose a random number between 1 and 2 and choose the database depending on the output.

If your users are performing updates and inserts, you need to figure out some kind of replication...Replication in mySQL.

Good luck,
-SN


0

Response Number 4
Name: fambi
Date: June 13, 2005 at 10:15:58 Pacific
Reply:

As your initial set-up assumes that the website is local to the db, you will also have to include some for of permissions for your seconds site to access it (if it is not local to the db).

Looking for a bulk sms gateway or just want to send sms? Let me know, that's what i do!


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Simple automated newslett... Problems installing APACH...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: Question about shared database

Questions about building a site www.computing.net/answers/webdevel/questions-about-building-a-site/1169.html

RE: Few questions about website d.. www.computing.net/answers/webdevel/re-few-questions-about-website-d/4011.html

Question about whois database www.computing.net/answers/webdevel/question-about-whois-database/2823.html