Joe H
Joe H

Reputation: 21

Mysql Master - Slave

We are planning to make one master and two slave configuration. we have objective as below. we have huge incoming records, hence we are planning to do below:

Master - has only past 7 days records Slave 1 - as same as Master (only 7 days records) but we are going to run some stored procedure to consolidate the records

Slave 2 - has all the records ( mostly last 3 months records ) ( we are planning to use SET sql_log_bin = 0 to stored procedure when ever we delete the records ( olderthan 7 days records in master ))

Here we have question,

is it okay to run store procedure in slaves to consolidate and delete the data?

what are the operation can we perform in slave other than reads?

is it safe use sql_log_bin = 0?

Upvotes: 1

Views: 45

Answers (1)

PowerStat
PowerStat

Reputation: 3821

From my experiences with myql master/slave configurations I would suggest the following:

  • Don't use stored procedures to consolidate or delete data - except you do this in a second schema which will NOT be replicated!

  • Your slave will be out of sync if you do something other than a read - for replicated schemas! - So for schemas that are not replicated you could do what you want.

  • For sql_log_bin see the answers for what's difference between sql_log_bin and log_bin in MySQL? - I would guess thats better to let sql_log_bin on.

Upvotes: 1

Related Questions