mysql - ZF2: Master/Slave replication with joins -
i have 2 databases: db1 , db2. created slave db1, called db1-slave.
db1 contains analytics table have high write rates, low read rates (which why created master/slave relationship). have master/slave feature set , ready go.
a problem when joining other database db2 reading, error occurs saying db2 not exist. not exist @ slave layer, , not prefer set replication (to preserve bandwidth).
$select = new select(); $select->from($this->table) ->columns(['*', 'count' => new \zend\db\sql\expression('count(app.id)')]) ->join('app', 'analytics.app_id = app.id', array('*'), 'left') ->join(new tableidentifier('ad', 'db2'), 'ad.id = analytics.event', array('*')) ->group('ad.id')->order('ad.id asc');
can modify in way enable reading db1-slave, , reading db2 on joins?
Comments
Post a Comment