Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lock-Free Consistency Control for Web 2.0 Applications Jiang-Ming Yang 1,3, Hai-Xun Wang 2, Ning Gu 1, Yi-Ming Liu 1, Chun-Song Wang 1, Qi-Wei Zhang 1.

Similar presentations


Presentation on theme: "Lock-Free Consistency Control for Web 2.0 Applications Jiang-Ming Yang 1,3, Hai-Xun Wang 2, Ning Gu 1, Yi-Ming Liu 1, Chun-Song Wang 1, Qi-Wei Zhang 1."— Presentation transcript:

1 Lock-Free Consistency Control for Web 2.0 Applications Jiang-Ming Yang 1,3, Hai-Xun Wang 2, Ning Gu 1, Yi-Ming Liu 1, Chun-Song Wang 1, Qi-Wei Zhang 1 1 Fudan University, 2 IBM T.J. Watson Research Center, 3 Microsoft Research Asia WWW 2008 2009. 05. 01 Summarized and presented by Hwang Inbeom, IDS Lab., Seoul National University

2 Copyright  2008 by CEBT Introduction  Many popular web sites have multiple mirrors Mirror sites – Easiest solution to achieve scalability – Users are able to choose nearest mirrors to get faster response 2 Mirror Sites

3 Copyright  2008 by CEBT Motivation  Traditional method for achieving consistency Aims to provide serialization of transactions – Locking protocol such as 2PL is used Bottleneck problem – More severe in Web 2.0 environment Shared documents could be edited by anyone Locking a object blocks all operations regarding it 3

4 Copyright  2008 by CEBT Main Ideas  Lock-free control Does not lock anything – More flexible concurrency control – Users can edit any part of shared document at any time Some inconsistency may exist – Execution order can be different site by site  Resolve conflicts by document synchronization Undoing and redoing operations are possible 4

5 Copyright  2008 by CEBT Problem Setting  Shared XML document  Operations expressed in two forms Querying Updating 5

6 Copyright  2008 by CEBT Causality Preservation  Causality Operation B is causally after operation A (A → B) – The user intends to execute B based on A’s result Example – A: Change the title “Advanced Statistical Learning” to “Statistical Learning” – B: Set the category of “Statistical Learning” to “Math” 6 Advanced Statistical LearningStatistical Learning Math

7 Copyright  2008 by CEBT Causality Preservation (contd.)  Dataflow 7 Site 1 Site 2 AA B B

8 Copyright  2008 by CEBT State Vector  State vector SV = Represents the state of a mirror site Each element is number of operations executed originated from site i  Causality preservation with state vector O is causally ready for execution at site j if – SV O [i] = SV j [i] + 1 – SV O [k] <= SV j [k] for all 1 ≤ k ≤ N and k ≠ i Remote site executing an operation must ensure it has been through the state at moment of initial execution – Remote site at least has same information of which site the operation is originated 8

9 Copyright  2008 by CEBT State Vector (contd.)  Example with dataflow 9 Site 1 Site 2 A A B B SV A = (1, 0) SV B = (2, 0) SV A = (1, 0) SV 2 = (0, 0) Hold SV 1 = (0, 0)

10 Copyright  2008 by CEBT Transactions  Each site creates a dummy operation Transaction operation executes after all dummy operations are executed Ensures all sites are in the same state before executing transaction operation 10

11 Copyright  2008 by CEBT Transactions (contd.)  Consistency control with a locking protocol and transaction operation work in almost same way  Then why is this scalable? Locking protocol treats every update operation as a transaction This does not – Not every update is a transaction – It can be treated like a transaction if it is needed (by users) 11

12 Copyright  2008 by CEBT Consistency Control  Non-transactional operations are executed immediately at their local site Different execution order of concurrent operations – May create inconsistent state Unified execution order is needed  Steps of execution Retrace and find an appropriate order, undo some operations Find nodes relevant to operation – For querying: Which nodes are descendant of this? – For updating: Is this node exist at the execution moment? Apply operation and redo undone operations 12

13 Copyright  2008 by CEBT Consistency Control (contd.)  How can we decide execution order of non-transactional operations? Operation C originated from site 1 – Add a “discount” tag to books in “Math” category Operation D originated from site 3 – Set the category of “Statistical Learning” to “CS” 13 Site 1 Site 3 CCDD Site 2 CD

14 Copyright  2008 by CEBT Consistency Control (contd.)  Ordering of non-transactional operations TOrder – if and only if sum(SV a ) < sum(SV b ) or a < b when sum(SV a ) = sum(SV b ) Operation with less information comes first in order If we cannot decide which operation has less information, use the ordering between sites they are originated  Ordering of transactions TOrder between NOOPs 14

15 Copyright  2008 by CEBT Storage Model  Keeps a inverted list of all nodes Interval-basis labels helps to find descendant and ancestor Providing faster response time 15

16 Copyright  2008 by CEBT Storage Model (contd.)  Attaches (create, delete) timestamp (=SV) to each XML node Nodes are not really deleted – Delete timestamp is added only Update operation consists of a delete and a create operation If timestamp of an operation is between (create, delete) of a node, the node can be affected by that operation – Retracing state of document when the operation is executed 16

17 Copyright  2008 by CEBT Experimental Setup  Five types of operations Three with this system – Query (AST Query ), non-transaction update (AST NU ), transaction update (AST TU ) Two with locking protocol – Query (LOCK Query ), update (LOCK Update ) 17

18 Copyright  2008 by CEBT Experiments  With varying command frequency AST NU (red) is almost same with LOCK Query (purple) Faster response to update operations 18

19 Copyright  2008 by CEBT Experiments (contd.)  Response time with varying operations’ proportion More non-transactional update, faster response 19

20 Copyright  2008 by CEBT Conclusions and Discussions  Authors proposed a new lock-free consistency control for Web 2.0 applications Providing more concurrency – Better load balance, high-speed access and faster response Supporting transactions also  Discussions Pros – Cut off the cost of non-transactional operations, which are not really needed to be a transaction Cons – What about conflict between operations within single site? – If data is not fully duplicated, which solution is possible? 20


Download ppt "Lock-Free Consistency Control for Web 2.0 Applications Jiang-Ming Yang 1,3, Hai-Xun Wang 2, Ning Gu 1, Yi-Ming Liu 1, Chun-Song Wang 1, Qi-Wei Zhang 1."

Similar presentations


Ads by Google