Joint Advanced Students School 2005

Slides:



Advertisements
Similar presentations
Types of Distributed Database Systems
Advertisements

1 Scaleable Replicated Databases Jim Gray (Microsoft) Pat Helland (Microsoft) Dennis Shasha (Columbia) Pat ONeil (U.Mass)
ICS 434 Advanced Database Systems
Database Architectures and the Web
Consistency and Replication Chapter 7 Part II Replica Management & Consistency Protocols.
Replication Management. Motivations for Replication Performance enhancement Increased availability Fault tolerance.
SQL Server Replication
Chapter 13 (Web): Distributed Databases
Database Replication techniques: a Three Parameter Classification Authors : Database Replication techniques: a Three Parameter Classification Authors :
CS 582 / CMPE 481 Distributed Systems
Distributed Database Management Systems
Overview Distributed vs. decentralized Why distributed databases
Understanding Replication in Database & Distributed Systems SRDS’ Database Replication Techniques: A Three Parameter Classification M. Wiesmann F.
Ch1: File Systems and Databases Hachim Haddouti
Distributed Systems Fall 2009 Replication Fall 20095DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
Chapter 12 Distributed Database Management Systems
Concurrency Control & Caching Consistency Issues and Survey Dingshan He November 18, 2002.
Definition of terms Definition of terms Explain business conditions driving distributed databases Explain business conditions driving distributed databases.
Distributed Databases
Query Processing in Mobile Databases
IMS 4212: Distributed Databases 1 Dr. Lawrence West, Management Dept., University of Central Florida Distributed Databases Business needs.
Practical Replication. Purposes of Replication Improve Availability Replicated databases can be accessed even if several replicas are unavailable Improve.
Replication and Consistency. Reference The Dangers of Replication and a Solution, Jim Gray, Pat Helland, Patrick O'Neil, and Dennis Shasha. In Proceedings.
Lecture 5: Sun: 1/5/ Distributed Algorithms - Distributed Databases Lecturer/ Kawther Abas CS- 492 : Distributed system &
Week 5 Lecture Distributed Database Management Systems Samuel ConnSamuel Conn, Asst Professor Suggestions for using the Lecture Slides.
Consistent and Efficient Database Replication based on Group Communication Bettina Kemme School of Computer Science McGill University, Montreal.
Database Architectures Database System Architectures Considerations – Data storage: Where do the data and DBMS reside? – Processing: Where.
Replicated Databases. Reading Textbook: Ch.13 Textbook: Ch.13 FarkasCSCE Spring
Lecture # 3 & 4 Chapter # 2 Database System Concepts and Architecture Muhammad Emran Database Systems 1.
Oracle's Distributed Database Bora Yasa. Definition A Distributed Database is a set of databases stored on multiple computers at different locations and.
IM NTU Distributed Information Systems 2004 Replication Management -- 1 Replication Management Yih-Kuen Tsay Dept. of Information Management National Taiwan.
Databases Illuminated
Replica Consistency in a Data Grid1 IX International Workshop on Advanced Computing and Analysis Techniques in Physics Research December 1-5, 2003 High.
Feb 1, 2001CSCI {4,6}900: Ubiquitous Computing1 Eager Replication and mobile nodes Read on disconnected clients may give stale data Eager replication prohibits.
1 Multiversion Reconciliation for Mobile Databases Shirish Hemanath Phatak & B.R.Badrinath Presented By Presented By Md. Abdur Rahman Md. Abdur Rahman.
Ing. Erick López Ch. M.R.I. Replicación Oracle. What is Replication  Replication is the process of copying and maintaining schema objects in multiple.
MBA 664 Database Management Systems Dave Salisbury ( )
Introduction to Distributed Databases Yiwei Wu. Introduction A distributed database is a database in which portions of the database are stored on multiple.
3/6/99 1 Replication CSE Transaction Processing Philip A. Bernstein.
Chapter 1 Database Access from Client Applications.
Highly Available Services and Transactions with Replicated Data Jason Lenthe.
Log Shipping, Mirroring, Replication and Clustering Which should I use? That depends on a few questions we must ask the user. We will go over these questions.
Distributed Databases
Business System Development
Chapter Name Replication and Mobile Databases Transparencies
Database Architectures and the Web
Nomadic File Systems Uri Moszkowicz 05/02/02.
AlwaysOn Mirroring, Clustering
Lecturer : Dr. Pavle Mogin
Peer-to-peer networking
6.4 Data and File Replication
Chapter 16 Designing Distributed and Internet Systems
Database Management System (DBMS)
Viney Sindhu Dr. Yanqing Zhang
Providing Secure Storage on the Internet
An Introduction to Computer Networking
Database management concepts
Chapter 10 Transaction Management and Concurrency Control
Fundamentals of Databases
Replication and Recovery in Distributed Systems
Distributed Databases
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
Database management concepts
Introduction of Week 13 Return assignment 11-1 and 3-1-5
Distributed Database Management Systems
DATABASE TECHNOLOGIES
Introduction of Week 14 Return assignment 12-1
Database System Architectures
EEC 688/788 Secure and Dependable Computing
Presentation transcript:

Joint Advanced Students School 2005 Replication and synchronization techniques in the context of mobile applications By Alexander Stage Software Engineering betrieblicher Informationssysteme (sebis) Ernst Denert-Stiftungslehrstuhl Lehrstuhl für Informatik 19 Institut für Informatik TU München wwwmatthes.in.tum.de JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 1

Agenda Motivation Mobile Computing Synchronization Techniques Replication Techniques in Databases Oracle Lite 10g – A Mobile Database Solution Peer to Peer Mobile Computing Future Applications and Developments JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 2

Motivation – A Scenario The disconnected sales-person problem: a typical day Mobile Device Local DB synchronize Mobile Device Local DB replicate Company Central DB Mobile Device Local DB update no communication link travelling path Customer A Customer B Customer C JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 3

Agenda Motivation Mobile Computing Synchronization Techniques Replication Techniques in Databases Oracle Lite 10g – A Mobile Database Solution Peer to Peer Mobile Computing Future Applications and Developments JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 4

Mobile Computing - Characteristics Mobile devices: Laptops Palmtops Smart cell phones Requirements: Data access: Anywhere Anytime Nomadic users Constraints: Limited ressources Variable connectivty: Performance Reliability JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 5

Mobile Computing – Communication Models Client Server Model Peer to Peer Model Client Client Client/ Server Client/ Server Server Client/ Server Client/ Server Client Client JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 6

Two Types of Synchronization Process synchronization Data synchronization System A System B Process A Process B modification Process Process Time Data item 1 modification modification Synchronization Data Item 1 Data Item 1 Process A correspondance modification Data item 1 Time 1: 1 Synchronization 1: 1 Synchronization Main System Process B modification Data Item 1 Data item 1 JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 7

Aspects of Synchronization Amount of participating system: 1:1 1:n Amount of exchanged data: Incremental Usage of timestamps, attached to data items Comparison of sub data structures and exchange Full Conflict resolution mechanisms Questions: who wins ? Merging System time synchronization in distributed systems JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 8

Merging Data During Synchronization: The Product - Sales Example System A System B System A System B Order 50 units of product A Order 25 units of product A Order Product A: 50 Order Product A: 25 Stock Product A: 100 Stock Product A: 100 Stock Product A: 50 Stock Product A: 75 No communiation Apply updates Main System Main System Stock Product A: 25 Stock Product A: 100 Reduce stock, Insert order Reduce stock, Insert order No conflict, minimum stock is preserved JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 9

Synchronization solutions File system oriented: Unix tool rsync: Incremental exchange of files Coda file system Version control systems: CVS WEBDav protocol: HTTP based file transfer protocol Locking and Versioning included Mobile Application oriented: Microsoft Active Sync: Synchronization between Desktop and Windows CE mobile devices JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 10

Standardization Efforts in Data Synchronization: SyncML SyncML defines client server based protocol for synchronization SyncML is XML based, main elements: SyncMessage Sync Commands: Modification commands: add, copy, delete, put and replace Query commands: read and search Response commands: status and results Execution specific commands: sequence and atomic Synchronization models: Two way sync Slow sync One way sync Refresh sync Server-alerted sync JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 11

SyncML Architecture Source: SyncML Representation Protocol, version 1.0.1, http://www.syncml.org/docs/syncml_represent_v101_20010615.pdf JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 12

Agenda Motivation Mobile Computing Synchronization Techniques Replication Techniques in Databases Oracle Lite 10g – A Mobile Database Solution Peer to Peer Mobile Computing Future Applications and Developments JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 13

What is Replication ? Usage of multiple copies of server system (replicas) Goals: Higher availability Better performance Areas of usage: Distributed Systems and Databases Replicated Server Only Ressource Server 1 Server n ........ Replicated Ressource and Server Ressource n Ressource 1 ........ Server n Server 1 JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 14

Replication in Databases Replication of the resource replicating the database Elimination of single point of failure Single server behaviour Correctness criterion: one-copy serializability Synchronization in databases: replication Constant trade-off between consistency and efficiency Update anywhere, anytime, any way replication scheme Simple case: Only a few replica nodes Low transaction rates Small amount of deadlocks and reconciliation System scale up: Problem complexity grows drastically at cubic rates Inconsistent replicas and system delusion (no way to repair the inconsistencies) JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 15

Replication in Databases – A Classification Scheme Classification dimensions: Where Dedicated replica: Single Master (primary master): primary and secondaries Every replica: Multi Master (update everywhere) When Synchronous (eager replication) Asynchronous (lazy replication) Other (not considered here) Interaction activities (network traffic) Constant or linear growth Transaction termination: Voting or Non-Voting techniques JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 16

Abstract Functional Replication Model Distinction between different replication solutions: Phase ordering Phase skipping Request Phase: Client sends a request to one or all replicas Server Coordination Phase: Replicas coordinate their work with each other (ordering of Execution steps) Execution Phase: Replicas execute operation Agreement Coordination Phase: Replicas ensure that they all have done the same thing (2pc) Client Response Phase: Client receives a response JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 17

Synchronous Single Master Replication I Characteristics Keeps all replicas synchronous in consistent state No update anomalies Reduces performance Increase response times Possible solution Trigger on selected tables Updates remotely all replicas Fails if one replica fails Usage of 2pc Implication: No control over when replication should take place Only databases with 2pc support JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 18

Synchronous Single Master Replication II (primary) (secondary) (secondary) Source: Wiesmann, Pedone, Schiper, Kemme, Alonso: Understanding Replication in Databases and Distributed Systems, Proceedings of 20th International Conference on Distributed Computing Systems (ICDCS'2000) JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 19

Asynchronous Single Master Replication I Characteristics Response after primary processed request: Primary takes care about transaction ordering Drawback: stale data items versions Performance is main goal Possible solutions Database system log based propagation: Committed updates only Restriction: Wait for current transactions Further improvement: only send data fields Log table: Trigger records update and insert actions Periodically recreate log table Send log table to replicas (preserving oder) JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 20

Asynchronous Single Master Replication II (primary) (secondary) (secondary) Source: Wiesmann, Pedone, Schiper, Kemme, Alonso: Understanding Replication in Databases and Distributed Systems, Proceedings of 20th International Conference on Distributed Computing Systems (ICDCS'2000) JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 21

Handling Failures Two types of failure: Replica fails: Secondary System not affected Secondary catch up Primary Re-election of primary Most up-to-date replica: common system state Possible data loss Network partition Problem: Which partition is allowed to process further requests ? Majority consensus algorithms Quorum consensus algorithms Danger: Dramatic system performance loss JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 22

Synchronous Multi Master Replication I Similar to single master synchronous replication Updates allowed at every replica JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 23

Synchronous Multi Master Replication II Source: Wiesmann, Pedone, Schiper, Kemme, Alonso: Understanding Replication in Databases and Distributed Systems, Proceedings of 20th International Conference on Distributed Computing Systems (ICDCS'2000) JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 24

Asynchronous Multi Master Replication I Characteristics Multi version concurrency control mechanisms Conflicts Reconciliation Automatic Manually Possible solution Unique timestamps Concatenation of local replica system clock to replica identifier Thomas Write Rule: Update applied if timestamp numerical greater than local timestamp Also known as optimistic replication JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 25

Asynchronous Multi Master Replication II (primary) (primary) (primary) Source: Wiesmann, Pedone, Schiper, Kemme, Alonso: Understanding Replication in Databases and Distributed Systems, Proceedings of 20th International Conference on Distributed Computing Systems (ICDCS'2000) JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 26

Replication Requirements in Mobile Context Disconnected operations require Asynchronous Multi Master Replication More frequent reconciliation because of Lazy replication Message delays JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 27

Replication Techniques - Summary Replication classification scheme Update propagation Eager / synchronous primary server Lazy / asynchronous Update everywhere Lazy / asynchromnous Update location JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 28

Agenda Motivation Mobile Computing Synchronization techniques Replication techniques in databases Oracle Lite 10g – A Mobile Database Solution Peer to Peer Mobile Computing Future Applications and Developments JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 29

Oracle Lite 10g – A Mobile Database Solution Supports disconnected mobile database applications Local database (snapshot) on mobile device Content: subset of enterprise database Synchronization with enterprise database Central component: Mobile Server Application Model Publication Deployed on Mobile Server Distribution of application code Distribution of SQL defined snapshots (controllable by variable) JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 30

Oracle Lite 10g Architecture Source: Oracle® Database Lite Developer's Guide 10g (10.0.0) Part No. B13788-0 JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 31

Oracle Lite 10g Synchronization Process I Snapshot Keeps track of local modifications Three types of publication items (application depended) Complete refresh All data items Fast refresh Incremental (updates and inserts) Queue based refresh No refresh (e.g. data collection: newly created data items) Asynchronous synchronization Central component Mobile Server Via „In queues“ and „Out queues“ JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 32

Oracle Lite 10g Synchronization Process II Source: Oracle® Database Lite Developer's Guide 10g (10.0.0) Part No. B13788-0 JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 33

Oracle Lite 10g Evaluation Well suited for „build from scratch“ Enterprise database directly accessible from Mobile Server „Mobile only“ or „Designed for mobility“ applications Existing data access layers not supported (EJB, CORBA, other) Duplication of mission-critical data access logic Possible code portation efforts Maintenance efforts increase Benefits reduced or outweighted JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 34

Agenda Motivation Mobile Computing Synchronization techniques Replication techniques in databases Oracle Lite 10g – A Mobile Database Solution Peer to Peer Mobile Computing Future Applications and Developments JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 35

Peer to Peer Mobile Computing Shortcommings of client server model No true mobility No communication between mobile devices Requirements Any to any communication All devices equal Large replication factors Careful data replication JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 36

The Ward Model I Ward 2 Ward 3 Ward member Ward 1 Ward master Overlapped ward member JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 37

The Ward Model II Dynamically reconfigurable synchronization topology All units equal mobile peers: Intra ward mobility Inter ward mobility Ward changing (heavyweight) Ward overlapping (lightweight) Ward master: Re-electable Knows ward members No storage of ward member data Manages data import / export for ward JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 38

The Ward Model III Second, top-level ward: all ward master Ward set: data of all ward members within one ward Changes over time Optimistically replicated within ward Selective replication: intra- and inter-ward JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 39

Two Tier Replication Characteristics Comparable with ward model Static backbone of stationary replicated database servers Mobile replicas connect eventually at all stationary replicas Benefit Compromise between efficiency and true mobility Possible improvement: Combination with ward model (selective replication) JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 40

Agenda Motivation Mobile Computing Synchronization techniques Replication techniques in databases Oracle Lite 10g – A Mobile Database Solution Peer to Peer Mobile Computing Future Applications and Developments JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 41

Future Applications and Developments Car to car communication (http://www.car-to-car.org) Mobile network of communicating cars Security services Development of replication schemes, based on ward model ? Moving wards Multi level ward hierachy JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 42

Thanks for your attention ! JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 43

Discussion Try to describe other real world usage scenarios of mobile applications, where synchronization and replication techniques need to be used Which technologies could be helpful for application level data replication and integration. Think of technologies in the field of Enterprise Application Integration (EAI). Which advantages and disadvantages can be identified with respect to requirements in mobile applications JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 44

Appendix I: SyncML Example Source: SyncML Representation Protocol, version 1.0.1, http://www.syncml.org/docs/syncml_represent_v101_20010615.pdf JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 45

Appendix II: Majority Consensus Algorithm I Secondary 1 Secondary 1 Secondary 2 Network Partition Secondary 2 Primary Primary Secondary 3 Secondary 4 Secondary 4 Secondary 3 JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 46

Appendix II: Majority Consensus Algorithm II Secondary 2 Secondary 1 2,5 < 2 3 Inactive Partition Working partition Old Primary New Primary Secondary 4 JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 47

Appendix III: Quorum Consensus Algorithm I Weight: 1 Secondary 1 Weight: 1 Weight: 2 Secondary 1 Primary Primary Weight: 2 JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 48

Appendix III: Quorum Consensus Algorithm II > Partition weight = 2 Partition weight = 1 Working partition Weight: 2 Inactive partition Weight: 1 Primary Secondary 1 JASS 05 Synchronization and Replication in the Context of Mobile Applications © Alexander Stage 49