Presentation is loading. Please wait.

Presentation is loading. Please wait.

© Alexander Stage 1JASS 05 Synchronization and Replication in the Context of Mobile Applications Joint Advanced Students School 2005 Replication and synchronization.

Similar presentations


Presentation on theme: "© Alexander Stage 1JASS 05 Synchronization and Replication in the Context of Mobile Applications Joint Advanced Students School 2005 Replication and synchronization."— Presentation transcript:

1 © Alexander Stage 1JASS 05 Synchronization and Replication in the Context of Mobile Applications 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

2 © Alexander Stage 2JASS 05 Synchronization and Replication in the Context of Mobile Applications Agenda oMotivation oMobile Computing oSynchronization Techniques oReplication Techniques in Databases oOracle Lite 10g – A Mobile Database Solution oPeer to Peer Mobile Computing oFuture Applications and Developments

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

4 © Alexander Stage 4JASS 05 Synchronization and Replication in the Context of Mobile Applications Agenda oMotivation oMobile Computing oSynchronization Techniques oReplication Techniques in Databases oOracle Lite 10g – A Mobile Database Solution oPeer to Peer Mobile Computing oFuture Applications and Developments

5 © Alexander Stage 5JASS 05 Synchronization and Replication in the Context of Mobile Applications Mobile Computing - Characteristics oMobile devices: nLaptops nPalmtops nSmart cell phones oRequirements: nData access: -Anywhere -Anytime nNomadic users oConstraints: nLimited ressources nVariable connectivty: -Performance -Reliability

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

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

8 © Alexander Stage 8JASS 05 Synchronization and Replication in the Context of Mobile Applications Aspects of Synchronization oAmount of participating system: n1:1 n1:n oAmount of exchanged data: nIncremental -Usage of timestamps, attached to data items -Comparison of sub data structures and exchange nFull oConflict resolution mechanisms nQuestions: who wins ? nMerging oSystem time synchronization in distributed systems

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

10 © Alexander Stage 10JASS 05 Synchronization and Replication in the Context of Mobile Applications Synchronization solutions oFile system oriented: nUnix tool rsync: -Incremental exchange of files nCoda file system oVersion control systems: nCVS nWEBDav protocol: -HTTP based file transfer protocol -Locking and Versioning included oMobile Application oriented: nMicrosoft Active Sync: -Synchronization between Desktop and Windows CE mobile devices

11 © Alexander Stage 11JASS 05 Synchronization and Replication in the Context of Mobile Applications Standardization Efforts in Data Synchronization: SyncML oSyncML defines client server based protocol for synchronization oSyncML is XML based, main elements: nSyncMessage nSync 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 oSynchronization models: nTwo way sync nSlow sync nOne way sync nRefresh sync nServer-alerted sync

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

13 © Alexander Stage 13JASS 05 Synchronization and Replication in the Context of Mobile Applications Agenda oMotivation oMobile Computing oSynchronization Techniques oReplication Techniques in Databases oOracle Lite 10g – A Mobile Database Solution oPeer to Peer Mobile Computing oFuture Applications and Developments

14 © Alexander Stage 14JASS 05 Synchronization and Replication in the Context of Mobile Applications What is Replication ? oUsage of multiple copies of server system (replicas) oGoals: nHigher availability nBetter performance oAreas of usage: Distributed Systems and Databases Replicated Server Only Ressource Server 1Server n........ Replicated Ressource and Server Ressource nRessource 1........ Server nServer 1........

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

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

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

18 © Alexander Stage 18JASS 05 Synchronization and Replication in the Context of Mobile Applications Synchronous Single Master Replication I oCharacteristics nKeeps all replicas synchronous in consistent state nNo update anomalies nReduces performance nIncrease response times oPossible solution nTrigger on selected tables nUpdates remotely all replicas nFails if one replica fails nUsage of 2pc nImplication: -No control over when replication should take place -Only databases with 2pc support

19 © Alexander Stage 19JASS 05 Synchronization and Replication in the Context of Mobile Applications Synchronous Single Master Replication II (primary) (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)

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

21 © Alexander Stage 21JASS 05 Synchronization and Replication in the Context of Mobile Applications Asynchronous Single Master Replication II (primary) (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)

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

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

24 © Alexander Stage 24JASS 05 Synchronization and Replication in the Context of Mobile Applications 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)

25 © Alexander Stage 25JASS 05 Synchronization and Replication in the Context of Mobile Applications Asynchronous Multi Master Replication I oCharacteristics nMulti version concurrency control mechanisms nConflicts nReconciliation -Automatic -Manually oPossible solution nUnique 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

26 © Alexander Stage 26JASS 05 Synchronization and Replication in the Context of Mobile Applications Asynchronous Multi Master Replication II (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)

27 © Alexander Stage 27JASS 05 Synchronization and Replication in the Context of Mobile Applications Replication Requirements in Mobile Context oDisconnected operations require nAsynchronous Multi Master Replication nMore frequent reconciliation because of -Lazy replication -Message delays

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

29 © Alexander Stage 29JASS 05 Synchronization and Replication in the Context of Mobile Applications Agenda oMotivation oMobile Computing oSynchronization techniques oReplication techniques in databases oOracle Lite 10g – A Mobile Database Solution oPeer to Peer Mobile Computing oFuture Applications and Developments

30 © Alexander Stage 30JASS 05 Synchronization and Replication in the Context of Mobile Applications Oracle Lite 10g – A Mobile Database Solution oSupports disconnected mobile database applications oLocal database (snapshot) on mobile device nContent: subset of enterprise database nSynchronization with enterprise database oCentral component: Mobile Server oApplication Model nPublication -Deployed on Mobile Server -Distribution of application code -Distribution of SQL defined snapshots (controllable by variable)

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

32 © Alexander Stage 32JASS 05 Synchronization and Replication in the Context of Mobile Applications Oracle Lite 10g Synchronization Process I oSnapshot nKeeps track of local modifications oThree types of publication items (application depended) nComplete refresh -All data items nFast refresh -Incremental (updates and inserts) nQueue based refresh -No refresh (e.g. data collection: newly created data items) oAsynchronous synchronization nCentral component Mobile Server nVia In queues and Out queues

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

34 © Alexander Stage 34JASS 05 Synchronization and Replication in the Context of Mobile Applications Oracle Lite 10g Evaluation oWell suited for build from scratch nEnterprise database directly accessible from Mobile Server nMobile only or Designed for mobility applications oExisting data access layers not supported (EJB, CORBA, other) nDuplication of mission-critical data access logic nPossible code portation efforts nMaintenance efforts increase nBenefits reduced or outweighted

35 © Alexander Stage 35JASS 05 Synchronization and Replication in the Context of Mobile Applications Agenda oMotivation oMobile Computing oSynchronization techniques oReplication techniques in databases oOracle Lite 10g – A Mobile Database Solution oPeer to Peer Mobile Computing oFuture Applications and Developments

36 © Alexander Stage 36JASS 05 Synchronization and Replication in the Context of Mobile Applications Peer to Peer Mobile Computing oShortcommings of client server model nNo true mobility nNo communication between mobile devices oRequirements nAny to any communication -All devices equal nLarge replication factors nCareful data replication

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

38 © Alexander Stage 38JASS 05 Synchronization and Replication in the Context of Mobile Applications The Ward Model II oDynamically reconfigurable synchronization topology oAll units equal mobile peers: nIntra ward mobility nInter ward mobility -Ward changing (heavyweight) -Ward overlapping (lightweight) oWard master: nRe-electable nKnows ward members nNo storage of ward member data nManages data import / export for ward

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

40 © Alexander Stage 40JASS 05 Synchronization and Replication in the Context of Mobile Applications Two Tier Replication oCharacteristics nComparable with ward model nStatic backbone of stationary replicated database servers nMobile replicas connect eventually at all stationary replicas oBenefit nCompromise between efficiency and true mobility oPossible improvement: nCombination with ward model (selective replication)

41 © Alexander Stage 41JASS 05 Synchronization and Replication in the Context of Mobile Applications Agenda oMotivation oMobile Computing oSynchronization techniques oReplication techniques in databases oOracle Lite 10g – A Mobile Database Solution oPeer to Peer Mobile Computing oFuture Applications and Developments

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

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

44 © Alexander Stage 44JASS 05 Synchronization and Replication in the Context of Mobile Applications Discussion oTry to describe other real world usage scenarios of mobile applications, where synchronization and replication techniques need to be used oWhich 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

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

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

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

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

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


Download ppt "© Alexander Stage 1JASS 05 Synchronization and Replication in the Context of Mobile Applications Joint Advanced Students School 2005 Replication and synchronization."

Similar presentations


Ads by Google