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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

Using separate DB connections on demand


Go to End


2 Posts   1429 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, 1899 Posts

1 November 2010 at 11:16pm