i found the solution by using this tool, RubeyRep its providing asynchronous replication and syncing option, in my case i can have master - master with out worrying about if the internet is got down delay lets say 1 minute or 2 minutes, its fine in my case,
Scan Features
rubyrep can scan corresponding tables of left and right database3 for diverging data.
- Different output modes: from count of differences over row diffs to full row dumps.
enter code here
Low bandwidth mode available: reduced number of round-trips; only actual differences go through the network.- Shows progress bar with estimated remaining amount of work.
Sync Features
All scan features also apply to syncs
Automatically orders table syncs to avoid foreign key conflicts.
Sync policy specifyable: ignore deletes in left database, ignore created records in right database, etc.
Prebuild conflict resolution methods available: left db wins, right db wins
Custom conflict resolution methods specifiable via ruby code snippets
Merge decisions can optionally be logged in the rubyrep event log table. Replication Features
Automatically sets up necessary triggers, log tables, etc.
Automatically discovers newly added tables and synchronizes the table content
Automatically reconfigures sequences to avoid duplicate key conflicts
Tracks changes to primary key columns
Can implement both master-slave and master-master replication
Prebuild conflict resolution methods availble: left / right wins; earlier / later change wins
Custom conflict resolution specifiable via ruby code snippets
Replication decisions can optionally be logged in the rubyrep event log table]2