Thursday, October 28, 2010

Re: Useing different database for the different actions

http://bakery.cakephp.org/articles/view/load-balancing-and-mysql-master-and-slaves-2 <-- since this link isn't working for Cake > 1.2.x, besides it didn't work for related model neither (from the comment on that article : "If this model is associated with other models using belongsTo, hasMany etc., only the data source for the primary model is switched.").

So, has anyone find a better solution for this master-slave loadbalancing problem?




On Tue, Mar 31, 2009 at 1:54 AM, Martin Westin <martin.westin.gc@gmail.com> wrote:

I think this is what you are looking for

http://bakery.cakephp.org/articles/view/load-balancing-and-mysql-master-and-slaves-2




On Mar 30, 6:28 pm, Alfredo Quiroga-Villamil <laww...@gmail.com>
wrote:
> Pippo:
>
> I've never done this or even thought about how to do it; so there
> might be a better way to accomplish what you want. Perhaps what I am
> about to tell you might not be a valid solution; but one thing that
> comes to mind is the following:
>
> Assuming that what you want is to read from one DB and perform CUD
> operations on the other one (Master), you could try to:
>
> Overwrite the methods related to "select" in AppModel and specify the
> DB to use for those cases. Do the same for methods that will be of CUD
> type in AppModel and point in this case to the other database you
> would like to use (master in this case)
>
> Everyone, please keep me honest here.
>
> Regards,
>
> Alfredo
>
> On Mon, Mar 30, 2009 at 11:42 AM, Pippo <phil...@wuermli.com> wrote:
>
> > Hi
>
> > We would like to use scalr.net and amazon webservices in order to be
> > able to scale if we have more and more users.
>
> > We would like to use one master Database and some slave Databases. The
> > synchronization in between of the different databases will go only in
> > one way, from the master to the slaves. This would mean that we need
> > to be able to differentiate in between of the actions done to the
> > database. All the Select statements (cakephp function find) would need
> > to go to the slaves, the Insert and Update statements should go to the
> > master database. The different Databases are on different Servers
> > (IP).
>
> > I couldn't find any information how this could be done with cakephp. I
> > have seen that I can use different databases by defining  useDbConfig
> > (http://book.cakephp.org/view/435/useDbConfig) but this would mean
> > that it would do all the type of SQL statement to one Database, no
> > matter whether it is a SELECT (read data) or an UPDATE or INSERT
> > (edit, create data).
>
> > Did someone have the same issue and does someone have a solution for
> > this?
>
> > Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---


Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
 
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: