-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
Goal of this ticket is to discuss and hopefully implement solution allowing single Piwik instance to query two replicant databases.
Outline of issue:
- big Piwik instances often have master-slave db replication,
- currently only use (in our case) of slave servers is to perform db backups, and in emergency cases to switch into master to provide HA
However slave servers could be put to much better use if we can redirect archiving queries onto slave db.
Long running and heavy queries could be triggered against slave, then results processed in PHP and write archives to master server.
This would significantly relieve tracker, take away some other problems with db performance when traffic peak meets long running archiving.
For initial scope, maybe only select queries triggered by LogAggregator could be launched against auxiliary db server, and in future we add option for developers to decide which db to use.
Even putting basic LogAggregator queries into slave would give significant boost to performance.
What do you think?