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

Is it possible to setup CouchDB like replication for MySQL?

  • Replication to be initiated from an web application.
  • Replication should be a two way process. i.e. Synchronization
  • If there is a failure in network connection, replication should take over where it left.
  • Schronization should be incremental.
  • The kind of data stored is Invoice.
  • Syncronization should be atomic. Either it should copy the whole invoice OR nothing.

Should I go for an custom synchronization logic here? I am planning to use Hibernate for data storage.

share|improve this question

1 Answer 1

You can configure MySQL in Master-Master mode in an active-passive configuration. One server will serve as the master while the other one stays in sync as a slave of the master (plain MySQL Replication is asynchronous in nature, btw). The secondary acts as the master of the primary, but since it's not being written to, nothing actually gets written back to the master in this case. If the primary fails, you can start using the secondary one as the main master (ie: point your app to it). Eventually when you fix the master, assuming all the data and configuration was intact, you can re-establish replication and it can pick up where it left off.

Check out the Multi-Master Replication Manager project that can help you achieve this:

http://mysql-mmm.org/

Good luck!

share|improve this answer
    
My goal is to use it for offline distributed application. Will Multi-Master replication help? –  user39184 Aug 30 '10 at 18:17
    
No, MySQL does not support distributed configurations. You can always shard your data, but this is extremely complex and generally not recommended. MySQL is much more like a RDBMS that CouchDB is. –  vmfarms Aug 30 '10 at 18:36
    
And also, MySQL Replication can't be setup from a web interface. It needs to be configured on the server directly. –  vmfarms Aug 30 '10 at 18:36

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.