Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a production webserver with a MySQL database setup as Master. I have a dev server with MySQL setup as Slave, with the data successfully being replicated from the Master.

What happens when a developer commits a chance to the Slave db? Is that commit going to screw up the whole setup?

If this is not the ideal situation for a Production / Dev / Staging setup, what would the ideal setup be?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

What happens when a developer commits a chance to the Slave db? Is that commit going to screw up the whole setup?

If you're committing to the same database that's being replicated then yes, it will most certainly screw things up.

You ought to have a completely different database that your developers can work against. If you want it to be refreshed periodically from production data, that would be fairly easy to set up and automate.

share|improve this answer
    
So what is the ideal way of dealing with this issue in a Prod/Dev env? –  Josh Brower Jul 13 '11 at 18:50
    
@Josh - see my edit. Your developers need a separate database instance. You're crazy and asking for trouble if you have them working directly against the production database. –  EEAA Jul 13 '11 at 18:52
    
I have no doubt that I am crazy... :) Though technically, they would be working against a copy of the prod db, not the actual prod db. –  Josh Brower Jul 13 '11 at 18:57
    
As they work against the prod replica, though, it will gradually get further and further out of sync with production and you'll never really know what state the db is in. Doing what you want to do is just a bad practice all around. Don't do it. –  EEAA Jul 13 '11 at 19:00
1  
You can use mysqldump to make the backups and then restore them with the mysql command. I would actually recommend setting up a dev environment for each developer on their local computer and then have a shared test/QA environment. That way they can mess up their own data without affecting everyone else. :-) –  Scott Warren Jul 13 '11 at 19:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.