310 likes | 446 Views
Design and Implementation of a Module to Synchronize Databases. Amit Hingher Reviewers: Prof. Dr. rer. nat. habil. Andreas Heuer Prof. Dr.-Ing. Hartmut Pfüller Advisor : Dr.-Ing. Holger Meyer Herr Andreas Finger Stefan Dummann (softEnergy GmbH) .
E N D
Design and Implementation of a Module to Synchronize Databases Amit Hingher Reviewers:Prof. Dr. rer. nat. habil. Andreas Heuer Prof. Dr.-Ing. Hartmut Pfüller Advisor: Dr.-Ing. Holger Meyer Herr Andreas Finger Stefan Dummann (softEnergy GmbH) Master Thesis, University Of Rostock, Germany 23rd May 2007
Overview • Introduction • Concept • WIS-Sync - A Prototype • Conclusions & Future Work Master Thesis, Amit Hingher
1. Introduction • Data Replication • Wind Information System (WIS) • Motivation • Existing Solution Master Thesis, Amit Hingher
What is Data Replication? • Database replication: • Process of creating and storing multiple copies of a database with the same data in different locations. • Two types of replication- • Synchronous • Asynchronous Master Thesis, Amit Hingher
Data Synchronization • Synchronization / Merge replication • Keeps the data in two or more locations up-to-date so that each repository contains identical information. • Copies data in both directions • Used for disconnected environment Master Thesis, Amit Hingher
WIS - Wind Information System • An innovative solution for complex analyses and monitoring of power plant data received from energy plants • GUI is provided by a Web server and can be accessed by client through a Web-Browser like IE or Mozilla • Diverse databases running on the server and client i.e. Oracle, Sybase, MySQL • Communication only possible between server and remote replicas and no “inter-replica” communication Master Thesis, Amit Hingher
Motivation WIS Synchronize Local copy Server No communication link Local copy Master Thesis, Amit Hingher
System Overview Master Thesis, Amit Hingher
Existing Solution WIS Master Thesis, Amit Hingher
Why another solution ? • Dumping whole DB to client • Alternative to log based capture – • A middle-ware replication tool that intercepts command stream between application and database • Synchronization tool relies entirely on transaction log • Cost of maintenance • Currently no manual interaction Master Thesis, Amit Hingher
2. Concept • Proposed System • WIS-Sync: A 3-Step Process • Capture process • Merge Process - Conflict Resolution • Table Filtering • Incremental progress • Manual resolution Master Thesis, Amit Hingher
WIS-Sync: A 3-Step Process Master Thesis, Amit Hingher
Golding’s Timestamp Anti-Entropy Protocol • Updates are propagated via anti-entropy sessions in which two replicas exchange the content of their logs Master Thesis, Amit Hingher
WIS-Sync: Capture Process Master Thesis, Amit Hingher
Conflict Resolution - Basics • A conflict is said to arise when rows with same unique ID from the same tables are updated on different databases • Resolution option used: • Server- Wins • Client-Wins Master Thesis, Amit Hingher
Conflict Scenario - 1 • Insert – Insert Master Thesis, Amit Hingher
Conflict Scenario - 2 • Update - Delete Master Thesis, Amit Hingher
Conflict Scenario - 3 • Update-Update Master Thesis, Amit Hingher
WIS-Sync: Merge Process Master Thesis, Amit Hingher
Table-Filtering • Allows user to select the tables he wants to synchronize • Provides maximum flexibility • User has full control over the system thus avoiding any unnecessary updates Master Thesis, Amit Hingher
Incremental Progress Master Thesis, Amit Hingher
Violations – An Example Master Thesis, Amit Hingher
How has this research helped ? • Features & Improvements • Capture Process - “direct-to-database” method • Table filtering • Conflict Resolution • Incremental progress • Manual resolution • Support for heterogeneous databases Master Thesis, Amit Hingher
3. WIS-Sync : A Prototype Master Thesis, Amit Hingher
OJB – ObJect Relational Bridge • Apache (OJB) is an Object/Relational mapping tool that allows transparent persistence for Java Objects against relational databases. • Supports the following DB’s: • MSSQL • MySQL • Oracle • MS Access • PostgreSQL • Informix • Sybase • MaxDB Master Thesis, Amit Hingher
O/R Mapping Master Thesis, Amit Hingher
WIS-Sync: Class Diagram Master Thesis, Amit Hingher
WIS-Sync: Configuration Page Master Thesis, Amit Hingher
3. Conclusions • No general solution available toward synchronization • Principal goal of an update propagation strategy is to ensure internal and mutual consistency • “Direct-to-database” approach can prove to be an alternative to log-based capture • O/R Mapping can be used in scenarios where compatibility between diverse databases is needed. Master Thesis, Amit Hingher
Future Work • User-friendly GUI Interface • Multiple users synchronizing • Could be implemented for a mobile as well. Master Thesis, Amit Hingher
Thank you all !!! Master Thesis, Amit Hingher