Page 1 of 1

Joomla Master-Slave Database

Posted: Wed Nov 29, 2017 8:05 am
by a_nasri
Hello everybody

I have got a customer who has a huge traffic on their site specially on Database record, now I want to share the load to two different servers some sort of master and slave database, in this scenario DB update,insert,delete will be write on the master and other records which are constant and needn't be updated frequently read from the slave at the end master and salve will be sync.

Do you think it is possible to do it?

Re: Joomla Master-Slave Database

Posted: Thu Nov 30, 2017 6:40 pm
by andypooz
Sounds like the perfect way to make a small problem a lot bigger to me. You're better off looking at optimising your database or using load balancing solutions.
Everything is possible, but what you're suggesting sounds massively complicated, is prone to concurrency issues, and will probably end up making things slower

Re: Joomla Master-Slave Database

Posted: Thu Nov 30, 2017 6:41 pm
by andypooz
Are the tables receiving the hits the core joomla tables or part of an extension/custom dev? If the latter, you might want to look at query optimisation too.

Re: Joomla Master-Slave Database

Posted: Thu Dec 28, 2017 1:49 am
by RedEye
andypooz wrote:Sounds like the perfect way to make a small problem a lot bigger to me. You're better off looking at optimising your database or using load balancing solutions.
Everything is possible, but what you're suggesting sounds massively complicated, is prone to concurrency issues, and will probably end up making things slower
First of all, just because it sounds complicated to you doesn't mean it is!
Secondly, don't say it is prone to concurrency issues when you don't know!!
And for third, No, it is not the perfect way to make a small problem a lot bigger... it is a perfect way to speed up a site!!!
Unlucky for us, however, is the fact that Joomla is not build with master/slave setup in mind, what in my eyes is a very big minus, but I am pretty sure there is a plugin for this even for Joomla.

Re: Joomla Master-Slave Database

Posted: Thu Aug 23, 2018 2:02 pm
by fids
@a_nasri, did you solve this problem?
I also run a very large site on a dedicated server with decent specs (32GB RAM, 4 cores, 350 Ghz) but I noticed a long time ago that as my database grows (users, sessions and content), so does the server slow down, almost to an unusable speed.
I did some optimisation by hacking some core joomla files, but that only helped a little. In the end, I split my 800MB joomla database into multiple parts, and I load the right tables programatically. I had to hack joomla core files for that - was too lazy to write a plugin for the job.
As the site continues to grow, this set up has become harder to maintain, so I want to try database replication instead, where the "read" load would be shared between the master and two or three slaves. I can always add slaves as needed. I think this is what you were trying to achieve. Did it work?

Re: Joomla Master-Slave Database

Posted: Tue Apr 23, 2019 8:14 pm
by bxi
A different reason for a master-slave concept than loadsharing/peformance is availability and support for disconnected operation. If the network is cut in pieces your operation may depend on a local copy of your website in each piece. To keep these copies updated, you need to push changes from your master to a set of slaves. This seems hard to accomplish using Joomla. Any ideas?