I have a requirement for auditing in MySQL database. It means I am interested in what data is changed in my database and when. For fulfilling this requirement I am thinking about the triggers. I am also using row based replication which ensures that data from master database is copied on slave machine. Since triggers might reduce the performance and it can introduce additional issues like row locking, I would like to avoid it on master database. Instead I would like to define triggers only on slave machine. Since data on slave will be identical with master, my requirement of auditing will be fulfilled also I can avoid performance and locking issues on master. Following are my environment details
- MySQL version 5.6 on windows
- Master and Slave database with row based replication
So my questions are
- Is it possible in MySQL to define the triggers only on slave?
- Is this a correct approach?
- Will it create any serious issue?