The process of database sync allows having up-to-date data in synched databases without extra effort from your side.
Our DBSync synchronizers are able to sync data in a heterogeneous environment that spans across databases and networks either in one way from source to destination or perform Bidirectional synchronization as well.
In case of the most simple one-way sync process programs transfer distinctive data in one direction from master (Source) to slave (target) database. This mode is used, for example, for offloading part of data or a whole database for further analysis and reporting. Another case is using it for backup purposes in the event of failure or maintenance of an active database. Sometimes source and target databases have a different structures and subset of data need to be transferred in one direction. For instance, customers put orders on a e-commerce web site and then the data passed to call center to process these orders.
Bidirectional synchronization is used when it’s necessary to keep all synced databases identical with the up-to-date information collected from all nodes. Data is replicated across all nodes, where all of them actively participate in data exchange. This configuration can be used to replicate the same data between several nodes to reduce server loads and for making faster access to multiple web sites from different locations.
- Please back up your data before running bidirectional synching for the first time.
- Check “Bidirectional sync” option at the Customization step and synchronizer will perform all the rest automatically.
- Bidirectional synchronization uses triggers to track data changes. Therefore, 'Trigger-based sync’ option has to be checked as well (it is checked by default).
- Requirement: Don’t change time on the source and destination servers manually. Anyway, if the server time has been changed, just clear history tables and assign triggers once again.
Bi-directional synchronization is available for the following directions:
- Oracle and MySQL
- Oracle and MS SQL Server
- MySQL and MS SQL Server
- MS SQL Server and PostgreSQL
- MySQL and PostgreSQL
- Firebird and MS SQL Server
- Firebird and MySQL
- Oracle and PostgreSQL
Bidirectional synchronization. How it works?
The following example illustrates bi-directional sync process. For the simplicity let's assume that table structures are the same for both tables.
Initially two tables have the following data:
Then we change the row #6 in both databases
In the next step, we modify row #7 in both tables. But firstly changes were made in TABLE 2, then in TABLE 1.
Now let's start Bidirectional sync. Make sure you have checked options 'Trigger-based sync’ and 'Bidirectional sync'
As a result, we've got identical data in either TABLE 1 or TABLE 2.
Tables have the most recent data according to the latest changes sorted by time. The row # 6 data came from TABLE 2 and the row # 7 has the data from TABLE 1.
One-way synchronization. How is it different from Bidirectional sync?
In one-way synchronization, all changes from primary table are transferred to secondary one, but no changes are ever copied back to the primary table.
Let's assume that originally two tables have the following data:
Then we change data in rows #6 and #7 in primary table:
Now let’s carry out one-way synchronization. Note, that 'Bidirectional sync' option is checked off:
As a result, we have the identical data in both tables. In this case data come in one direction only from TABLE 1 to TABLE 2.