ohdang888 Posted April 11, 2009 Share Posted April 11, 2009 I've got a question on efficiency....Is there a benefit to making your site use several databases... in other words, say you have a good-sized site...does it lighten the load and increase mysql speed if the site uses several db's instead of using 1 large database. thanks. Quote Link to comment https://forums.phpfreaks.com/topic/153643-solved-php-mysql-database-flow/ Share on other sites More sharing options...
Mchl Posted April 11, 2009 Share Posted April 11, 2009 If they're still on one server it doesn't make much of a difference. Quote Link to comment https://forums.phpfreaks.com/topic/153643-solved-php-mysql-database-flow/#findComment-807360 Share on other sites More sharing options...
9three Posted April 11, 2009 Share Posted April 11, 2009 Well if you separate the load into 2 servers, you can't share the information across servers. If you are looking for efficiency I suggest using PDO extension. By using prepared statements you get a performance boost. Quote Link to comment https://forums.phpfreaks.com/topic/153643-solved-php-mysql-database-flow/#findComment-807362 Share on other sites More sharing options...
Mchl Posted April 11, 2009 Share Posted April 11, 2009 By using prepared statements you get a performance boost. Do you? Not much in most cases. Separating load to two or more servers is possible with replication. You can have one master to which all data modifying queries (INSERT, UPDATE, DELETE) are directed, and a bunch of slaves that respond to SELECT queries. There's also possibility to set up a circular replication. In general however, when looking for performance, you should usually first take a look at your database design and your queries. That's the place you can squeeze most from. Quote Link to comment https://forums.phpfreaks.com/topic/153643-solved-php-mysql-database-flow/#findComment-807370 Share on other sites More sharing options...
ohdang888 Posted April 11, 2009 Author Share Posted April 11, 2009 You can have one master to which all data modifying queries (INSERT, UPDATE, DELETE) are directed, and a bunch of slaves that respond to SELECT queries. There's also possibility to set up a circular replication. In general however, when looking for performance, you should usually first take a look at your database design and your queries. That's the place you can squeeze most from. so efficiency is increased by having 2 or more MySQL users rather than 1 all privelage one??? Quote Link to comment https://forums.phpfreaks.com/topic/153643-solved-php-mysql-database-flow/#findComment-807519 Share on other sites More sharing options...
Mchl Posted April 11, 2009 Share Posted April 11, 2009 No. By having two (or more) separate physical servers. Quote Link to comment https://forums.phpfreaks.com/topic/153643-solved-php-mysql-database-flow/#findComment-807522 Share on other sites More sharing options...
ohdang888 Posted April 11, 2009 Author Share Posted April 11, 2009 oh alright. So in a sense, it could technically be even more inefficient to have a 2-database system because of the "db_select" function that has to be called for each database switch? Quote Link to comment https://forums.phpfreaks.com/topic/153643-solved-php-mysql-database-flow/#findComment-807535 Share on other sites More sharing options...
Mchl Posted April 11, 2009 Share Posted April 11, 2009 Not by much... apart from the fact that such setup would be pointless and confusing. Quote Link to comment https://forums.phpfreaks.com/topic/153643-solved-php-mysql-database-flow/#findComment-807539 Share on other sites More sharing options...
redarrow Posted April 11, 2009 Share Posted April 11, 2009 Just use a dedicated mysql server like most of us. what the reason off the post your, data going slow? if so post your database schema and sql querys. Quote Link to comment https://forums.phpfreaks.com/topic/153643-solved-php-mysql-database-flow/#findComment-807546 Share on other sites More sharing options...
ohdang888 Posted April 11, 2009 Author Share Posted April 11, 2009 not having problems now but i'm building an app platform and im just making sure it wont be a problem later... i'm not expecting the site to get many members, its just that it has a lot of sql in it Quote Link to comment https://forums.phpfreaks.com/topic/153643-solved-php-mysql-database-flow/#findComment-807575 Share on other sites More sharing options...
Mchl Posted April 12, 2009 Share Posted April 12, 2009 If that's so, start with these tips. http://dev.mysql.com/doc/refman/5.0/en/optimization.html Quote Link to comment https://forums.phpfreaks.com/topic/153643-solved-php-mysql-database-flow/#findComment-807757 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.