Design and Implementation of a Module to Synchronize Databases

31
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 23 rd May 2007

description

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) . - PowerPoint PPT Presentation

Transcript of Design and Implementation of a Module to Synchronize Databases

Page 1: Design and Implementation of a Module to Synchronize Databases

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

Page 2: Design and Implementation of a Module to Synchronize Databases

Master Thesis, Amit Hingher 2

Overview

Introduction

Concept

WIS-Sync - A Prototype

Conclusions & Future Work

Page 3: Design and Implementation of a Module to Synchronize Databases

Master Thesis, Amit Hingher 3

1. Introduction

Data Replication

Wind Information System (WIS)

Motivation

Existing Solution

Page 4: Design and Implementation of a Module to Synchronize Databases

Master Thesis, Amit Hingher 4

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

Page 5: Design and Implementation of a Module to Synchronize Databases

Master Thesis, Amit Hingher 5

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

Page 6: Design and Implementation of a Module to Synchronize Databases

Master Thesis, Amit Hingher 6

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

Page 7: Design and Implementation of a Module to Synchronize Databases

Master Thesis, Amit Hingher 7

Motivation

LocalcopyWIS

Server

Localcopy

No communication link

Synchronize

Page 8: Design and Implementation of a Module to Synchronize Databases

Master Thesis, Amit Hingher 8

System Overview

Page 9: Design and Implementation of a Module to Synchronize Databases

Master Thesis, Amit Hingher 9

Existing SolutionWIS

Page 10: Design and Implementation of a Module to Synchronize Databases

Master Thesis, Amit Hingher 10

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

Page 11: Design and Implementation of a Module to Synchronize Databases

Master Thesis, Amit Hingher 11

2. Concept Proposed System

WIS-Sync: A 3-Step Process

Capture process

Merge Process - Conflict Resolution

Table Filtering

Incremental progress

Manual resolution

Page 12: Design and Implementation of a Module to Synchronize Databases

Master Thesis, Amit Hingher 12

WIS-Sync: A 3-Step Process

Page 13: Design and Implementation of a Module to Synchronize Databases

Master Thesis, Amit Hingher 13

Golding’s Timestamp Anti-Entropy Protocol Updates are propagated via anti-entropy

sessions in which two replicas exchange the content of their logs

Page 14: Design and Implementation of a Module to Synchronize Databases

Master Thesis, Amit Hingher 14

WIS-Sync: Capture Process

Page 15: Design and Implementation of a Module to Synchronize Databases

Master Thesis, Amit Hingher 15

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

Page 16: Design and Implementation of a Module to Synchronize Databases

Master Thesis, Amit Hingher 16

Conflict Scenario - 1

Insert – Insert

Page 17: Design and Implementation of a Module to Synchronize Databases

Master Thesis, Amit Hingher 17

Conflict Scenario - 2

Update - Delete

Page 18: Design and Implementation of a Module to Synchronize Databases

Master Thesis, Amit Hingher 18

Conflict Scenario - 3

Update-Update

Page 19: Design and Implementation of a Module to Synchronize Databases

Master Thesis, Amit Hingher 19

WIS-Sync: Merge Process

Page 20: Design and Implementation of a Module to Synchronize Databases

Master Thesis, Amit Hingher 20

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

Page 21: Design and Implementation of a Module to Synchronize Databases

Master Thesis, Amit Hingher 21

Incremental Progress

Page 22: Design and Implementation of a Module to Synchronize Databases

Master Thesis, Amit Hingher 22

Violations – An Example

Page 23: Design and Implementation of a Module to Synchronize Databases

Master Thesis, Amit Hingher 23

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

Page 24: Design and Implementation of a Module to Synchronize Databases

Master Thesis, Amit Hingher 24

3. WIS-Sync : A Prototype

Page 25: Design and Implementation of a Module to Synchronize Databases

Master Thesis, Amit Hingher 25

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

Page 26: Design and Implementation of a Module to Synchronize Databases

Master Thesis, Amit Hingher 26

O/R Mapping

Page 27: Design and Implementation of a Module to Synchronize Databases

Master Thesis, Amit Hingher 27

WIS-Sync: Class Diagram

Page 28: Design and Implementation of a Module to Synchronize Databases

Master Thesis, Amit Hingher 28

WIS-Sync: Configuration Page

Page 29: Design and Implementation of a Module to Synchronize Databases

Master Thesis, Amit Hingher 29

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.

Page 30: Design and Implementation of a Module to Synchronize Databases

Master Thesis, Amit Hingher 30

Future Work

User-friendly GUI Interface

Multiple users synchronizing

Could be implemented for a mobile as well.

Page 31: Design and Implementation of a Module to Synchronize Databases

Master Thesis, Amit Hingher 31

Thank you all !!!