Google Groups Home
Help | Sign in
Replication load balancing support?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
DavidJ  
View profile
 More options Dec 12 2006, 3:02 pm
From: "DavidJ" <David.Lisle.J...@gmail.com>
Date: Tue, 12 Dec 2006 20:02:49 -0000
Local: Tues, Dec 12 2006 3:02 pm
Subject: Replication load balancing support?
Hello.
I'm not a CakePHP user (yet) :)
Q: My current site uses MySql master/slave replication for load
balancing.  So, all SQL queries from a particular web-server host go to
its corresponding MySQL slave host, but all SQL updates/inserts must go
to the MySQL Master host.

Does Cake PHP have support for that (or any snippets etc.)?  If not,
would it be easy to acheive transparently from the rest of the CakePHP
app? (or would it require sprinkling something through the code
all-over?)

Thanks,
-David.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
nate  
View profile
(6 users)  More options Dec 12 2006, 5:16 pm
From: "nate" <nate.ab...@gmail.com>
Date: Tue, 12 Dec 2006 14:16:41 -0800
Local: Tues, Dec 12 2006 5:16 pm
Subject: Re: Replication load balancing support?
class DATABASE_CONFIG {

        var $default = array(
                'driver'                => 'mysql',
                'host'                  => 'slave.host.ip',
                'login'                 => '....',
                'password'              => '.....',
                'database'              => 'my_db'
        );

        var $master = array(
                'driver'                => 'mysql',
                'host'                  => 'master.host.ip',
                'login'                 => '....',
                'password'              => '.....',
                'database'              => 'my_db'
        );

}

class AppModel extends Model {

        function beforeSave() {
                $this->useDbConfig = 'master';
        }

        function afterSave() {
                $this->useDbConfig = 'default';
        }

        function beforeDelete() {
                $this->useDbConfig = 'master';
        }

        function beforeSave() {
                $this->useDbConfig = 'default';
        }


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
nate  
View profile
 More options Dec 12 2006, 5:17 pm
From: "nate" <nate.ab...@gmail.com>
Date: Tue, 12 Dec 2006 14:17:28 -0800
Local: Tues, Dec 12 2006 5:17 pm
Subject: Re: Replication load balancing support?
Oops, that last 'beforeSave' should actually read 'afterDelete'.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mariano Iglesias  
View profile
 More options Dec 12 2006, 5:29 pm
From: "Mariano Iglesias" <mariano.igles...@cricava.com>
Date: Tue, 12 Dec 2006 19:29:47 -0300
Local: Tues, Dec 12 2006 5:29 pm
Subject: RE: Replication load balancing support?
If that's not scalability, I don't know what is.

-MI

---------------------------------------------------------------------------

Remember, smart coders answer ten questions for every question they ask.
So be smart, be cool, and share your knowledge.

BAKE ON!


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
emiliano  
View profile
 More options Dec 12 2006, 9:03 pm
From: "emiliano" <ecast...@gmail.com>
Date: Wed, 13 Dec 2006 02:03:02 -0000
Local: Tues, Dec 12 2006 9:03 pm
Subject: Re: Replication load balancing support?
Wow... I just was wondering about this...

nate: cake it's incredible!!

emiliano

On 12 dic, 19:29, "Mariano Iglesias" <mariano.igles...@cricava.com>
wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google