What Is Database Synchronization?
Here you can find information about various types of synchronization: Insert, Update, Drop, Mixed.
Join the DZone community and get the full member experience.Join For Free
Database synchronization establishes data consistency between two or more databases, automatically copying changes back and forth. Harmonization of the data over time should be performed continuously. Pulling out data from source (master) database to destination (slave) is the most trivial case.
NOTE: Synchronization works on the base of Primary Key constraint. The structures of Databases should contain Primary Key or a Unique or Primary index, not a composite one.
Below you can find information about various types of synchronization:
- Insert Synchronization
- Update Synchronization
- Drop Synchronization
- Mixed Synchronization
Insert Database Synchronization
New records from the Source table will be automatically transferred to the target, in case there are no appropriate records in the destination table with identical Primary Key values. As a result of the Database Sync process, absent records will be inserted into destination tables.
The following scheme illustrates the "Insert synchronization process".
Update Database Synchronization
When changes in the source database occur, appropriate changes in target DB have to be performed. Synchronizer compares records' values at first. Then altered records will be replaced at destination tables to establish the identity between two tables. As a result of update synchronization, all your data keep updated.
Given below picture illustrates update sync process.
Drop Database Synchronization
If some records have been deleted from a source, corresponding records have to be deleted from the destination. With the checked "Drop-sync option," these old records will be removed from the target if they do not exist in the source.
The Drop sync process is shown schematically below.
Mixed Database Synchronization
For example, you've made modifications in your source tables, added completely new records, and removed obsolete rows. To keep your databases in relevance, you have to add, delete, and update these correspondent records in the destination database.
The picture below shows how Insert, Update and Drop sync options work together.
Check out cross-database conversion and synchronization software that migrates data between the most popular on-premises databases, including SQL Server, MySQL, Oracle, PostgreSQL.
Cloud Platforms like AWS RDS/ Aurora, Microsoft Azure SQL, Google Cloud SQL are supported.
Published at DZone with permission of Dmitry Narizhnykh. See the original article here.
Opinions expressed by DZone contributors are their own.
Decoding eBPF Observability: How eBPF Transforms Observability as We Know It
New ORM Framework for Kotlin
Personalized Code Searches Using OpenGrok
DevOps in Legacy Systems