Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Using separate DB connections on demand


Reply


2 Posts   683 Views

Avatar
ImacSS

Community Member, 35 Posts

31 October 2010 at 7:08am

Not sure where else I would post this question, so posting it to general.

Have a client who is using a heavily customized SS 2.3.2. They are running into DB performance issues and would like the ability to make all of the DB writes use one DB connection (a master db), and most/some reads use a different DB connection (a slave db).

Basically, they would want the ability to include which db connection to use at the method call level. So for instance, DataObject::get() would become DataObject::get_using_dbconn() with an additional argument specifying the database connection to use.

Has anyone ever had the need to do something like this with SilverStripe before? Is there support in the code base to handle this?

If not, can anyone point me in the right direction to try and satisfy this request?

Thanks in advance.

Avatar
swaiba

Forum Moderator, 1808 Posts

1 November 2010 at 11:16pm

This thread might help...

http://www.silverstripe.org/customising-the-cms/show/13692#post293308