Presentation is loading. Please wait.

Presentation is loading. Please wait.

T h e U n i v e r s i t y o f S o u t h e r n Q u e e n s l a n d Stijn DekeyserGriffith U. Seminar, October ’04 1 Towards a new approach to Document Collaboration.

Similar presentations


Presentation on theme: "T h e U n i v e r s i t y o f S o u t h e r n Q u e e n s l a n d Stijn DekeyserGriffith U. Seminar, October ’04 1 Towards a new approach to Document Collaboration."— Presentation transcript:

1 T h e U n i v e r s i t y o f S o u t h e r n Q u e e n s l a n d Stijn DekeyserGriffith U. Seminar, October ’04 1 Towards a new approach to Document Collaboration Stijn Dekeyser USQ, Australia Jan Hidders U. Antwerp, Belgium A Concurrency Control mechanism for XML databases

2 T h e U n i v e r s i t y o f S o u t h e r n Q u e e n s l a n d Stijn DekeyserGriffith U. Seminar, October ’04 2 Contents Introduction: XMLIntroduction: XML Running ExampleRunning Example Classic CC methodsClassic CC methods Data ModelsData Models –User Data Model –Scheduler Data Model Path Lock SchemesPath Lock Schemes –Propagation (PL-PROP) –Satisfiability (PL-SAT) SchedulersSchedulers –Commit scheduler –Conflict scheduler Part II Part I Asynchronous collaborative workAsynchronous collaborative work –cvs, change tracking, cscw, ems Synchronous collaborative workSynchronous collaborative work A new approach: use cases and clientsA new approach: use cases and clients DiscussionDiscussion

3 T h e U n i v e r s i t y o f S o u t h e r n Q u e e n s l a n d Stijn DekeyserGriffith U. Seminar, October ’04 3 Asynchronous collaborative work CVSCVS –Version repository + concurrency –Text, Line-based –Human intervention Change TrackingChange Tracking –MS Office, OOo et al –Human mgt + intervention Part I

4 T h e U n i v e r s i t y o f S o u t h e r n Q u e e n s l a n d Stijn DekeyserGriffith U. Seminar, October ’04 4 Asynchronous collaborative work CSCW & EMSCSCW & EMS –Many different systems –Docs distributed wholly at all sites –Messages update docs –Human intervention needed

5 T h e U n i v e r s i t y o f S o u t h e r n Q u e e n s l a n d Stijn DekeyserGriffith U. Seminar, October ’04 5 Synchronous collaborative work CSCW & EMSCSCW & EMS XML-enabled RDBMSXML-enabled RDBMS –Traditional table locking Native XML databasesNative XML databases –Document-based locking

6 T h e U n i v e r s i t y o f S o u t h e r n Q u e e n s l a n d Stijn DekeyserGriffith U. Seminar, October ’04 6 A new approach: use cases Document AuthoringDocument Authoring –May move section while updating CMSCMS –XForms causes overwrite Design & artDesign & art –May update same parts! ProgrammingProgramming –Change function name globally

7 T h e U n i v e r s i t y o f S o u t h e r n Q u e e n s l a n d Stijn DekeyserGriffith U. Seminar, October ’04 7 A new approach: servers –Implementation: Native or XML-enabled dbNative or XML-enabled db Use of Path Locks in transactionsUse of Path Locks in transactions Document collaboration protocol (dcp)Document collaboration protocol (dcp) –Type: Enhanced web server, e.g. in ApacheEnhanced web server, e.g. in Apache or P2P implementation, e.g. in Wordor P2P implementation, e.g. in Word –Extra features: Access Control (Elena Ferrari et al.)Access Control (Elena Ferrari et al.) –Elements contain user rights version management (Epic)version management (Epic) –Elements contain version information

8 T h e U n i v e r s i t y o f S o u t h e r n Q u e e n s l a n d Stijn DekeyserGriffith U. Seminar, October ’04 8 A new approach: clients General purpose XML editorsGeneral purpose XML editors –E.g. Epic or XMLSpy Specific purpose XML editorsSpecific purpose XML editors –E.g. Autocad or Excel Issues:Issues: –Intelligently query section to be updated –Commit when possible –Refresh content

9 T h e U n i v e r s i t y o f S o u t h e r n Q u e e n s l a n d Stijn DekeyserGriffith U. Seminar, October ’04 9 Discussion

10 T h e U n i v e r s i t y o f S o u t h e r n Q u e e n s l a n d Stijn DekeyserGriffith U. Seminar, October ’04 10 Introduction: XML XML is evolution of document language technologyXML is evolution of document language technology –1969: GML (Generalized MarkUp L) –1974: SGML (Standard …), Goldfarb –1986: ISO standard –1989: HTML, Berners-Lee, Berglund, Cailliau at CERN XML much simpler than SGML (10% of spec)XML much simpler than SGML (10% of spec) Now: much more data stored as XMLNow: much more data stored as XML –Enter the XML-DBMS age… Part II

11 T h e U n i v e r s i t y o f S o u t h e r n Q u e e n s l a n d Stijn DekeyserGriffith U. Seminar, October ’04 11 Running example (1/2) Peter Parklane 7 John Unistreet 1 swimming cycling David Parklane 7 Mary Parklane 7 painting

12 T h e U n i v e r s i t y o f S o u t h e r n Q u e e n s l a n d Stijn DekeyserGriffith U. Seminar, October ’04 12 Running example (2/2) Queries: /document/person//hobby //child//hobby

13 T h e U n i v e r s i t y o f S o u t h e r n Q u e e n s l a n d Stijn DekeyserGriffith U. Seminar, October ’04 13 Classic CC methods (1/3) Table locking How: On update, whole table is lockedHow: On update, whole table is locked Precludes phantomsPrecludes phantoms XML: parent-child relation in 1 (*) tableXML: parent-child relation in 1 (*) table Example:Example: –Query: //child//hobby –Update that should be allowed: change hobby element not occuring under child –Not possible when entire table is locked

14 T h e U n i v e r s i t y o f S o u t h e r n Q u e e n s l a n d Stijn DekeyserGriffith U. Seminar, October ’04 14 Classic CC methods (2/3) Predicate locking HowHow –Locks in form of predicate: name=“person” –Predicate indicates what has been read Example:Example: –Query: /document/person//hobby –Update(ok): create person under root element –Update(~ok): create hobby under this person –Both are not possible since 1st predicate locks all person s under the root

15 T h e U n i v e r s i t y o f S o u t h e r n Q u e e n s l a n d Stijn DekeyserGriffith U. Seminar, October ’04 15 Classic CC methods (3/3) Hierarchical locking HowHow –Lock granule  intention lock on ancestors –Change granule  exclusive lock on X Tree locking HowHow –Lock node  lock parent of node –Add node under X  exclusive lock on X And... query //A//B requires shared-locks on entire tree

16 T h e U n i v e r s i t y o f S o u t h e r n Q u e e n s l a n d Stijn DekeyserGriffith U. Seminar, October ’04 16 User Data Model (1/2) Data Model (XPath-tree) Tree with labelled nodes(XPath-tree) Tree with labelled nodes –NB: we ignore ordering of children Path Expressions Sequence of tag names and wild-cards (*)Sequence of tag names and wild-cards (*) Separated by / (child) and // (descendants).Separated by / (child) and // (descendants). –person/child –*//person/child

17 T h e U n i v e r s i t y o f S o u t h e r n Q u e e n s l a n d Stijn DekeyserGriffith U. Seminar, October ’04 17 User Data Model (2/2) Query Q(n,p): yields set of nodes which are reachable from n via path expression p.Q(n,p): yields set of nodes which are reachable from n via path expression p. –Q(n, *//hobby ) Addition A(n,a): add node with name a under nA(n,a): add node with name a under n –A(n, hobby ) –Fails if n is not there, yields new node. Deletion D(n): delete nD(n): delete n –Fails if n has children. Commit C(): end of transactionC(): end of transaction Node-correctness: Thou shalt only use nodes which you have obtained via an addition or via a query.

18 T h e U n i v e r s i t y o f S o u t h e r n Q u e e n s l a n d Stijn DekeyserGriffith U. Seminar, October ’04 18 Scheduler’s Data Model (1/2) Instance GraphInstance Graph –Acyclic graph with labelled nodes –Nodes labelled with a delete set: Identifiers of transactions which deleted the node.Identifiers of transactions which deleted the node. Actual InstanceActual Instance –Subgraph of instance graph formed by the nodes with an empty delete set –Is always an XPath-tree

19 T h e U n i v e r s i t y o f S o u t h e r n Q u e e n s l a n d Stijn DekeyserGriffith U. Seminar, October ’04 19 Scheduler’s Data Model (2/2) Query Q(n,p): yields a set of nodes which are -- in the actual instance – reachable from n via path expression p.Q(n,p): yields a set of nodes which are -- in the actual instance – reachable from n via path expression p.Addition A(n,a): adds node with name a under nA(n,a): adds node with name a under n –Empty delete set –Fails if n is not in the actual instance. Deletion D(n): add transaction to the delete set of nD(n): add transaction to the delete set of n –Fails if n has children in the actual instance. Commit C(): delete nodes with transaction in delete setC(): delete nodes with transaction in delete set

20 T h e U n i v e r s i t y o f S o u t h e r n Q u e e n s l a n d Stijn DekeyserGriffith U. Seminar, October ’04 20 PL propagation scheme (1/3) Read Locks ● rl ( n, p ) ● e.g. rl ( n 12, //a//b) Required read locks: ● For Q(n,p) request rl(n,p) and do.... ● Read lock propagation: 1) rl(n, a/p) -> rl(n', p) if n' is an a-child of n 2) rl(n, */p) -> rl(n', p) if n' is a child of n 3) rl(n, a//p) -> rl(n', *//p) and rl(n', p) if n' is an a-child of n 4) rl(n, *//p) -> rl(n', *//p) and rl(n', p) if n' is a child of n ● Recomputing propagation on update is very easy (!)

21 T h e U n i v e r s i t y o f S o u t h e r n Q u e e n s l a n d Stijn DekeyserGriffith U. Seminar, October ’04 21 PL propagation scheme (2/3) Example: Doc. root document person child addrnameage person agenameaddrhobby person agenameaddr agenameaddrhobby *//child//hobby child//hobby *//child//hobby child//hobby *//child//hobby child//hobby *//child//hobby child//hobby *//child//hobby child//hobby *//hobby hobby *//child//hobby

22 T h e U n i v e r s i t y o f S o u t h e r n Q u e e n s l a n d Stijn DekeyserGriffith U. Seminar, October ’04 22 PL propagation scheme (3/3) Write Locks –wl( n, a ) or wl( n, * ) Required write locks: –For A(n,a) request: wl(n,a)wl(n,a) –For D(n) request: wl(n, *) if n existswl(n, *) if n exists wl(n', a) if n is an a-child of n'wl(n', a) if n is an a-child of n' Conflict rules: –wl(n, *) and wl(n, a) conflicts with rl(n, *) and rl(n, a) –All others do not. (... write-write conflicts?) Number of locks: updates: O(1) queries: O(|p|.|G|) Number of locks: updates: O(1) queries: O(|p|.|G|)

23 T h e U n i v e r s i t y o f S o u t h e r n Q u e e n s l a n d Stijn DekeyserGriffith U. Seminar, October ’04 23 Path-lock satisfiability scheme Read locks ● rl( n, p ) (see PL-Prop) ● For Q ( n, p ) only rl( n, p ) is necessary Write locks ● wl(n,a) and wl(n,*) ● For A(n,a) and D(n) necessary as w. PL-Prop. Conflict rules ● wl(n,a) and wl(n,*) conflict with rl(n',p) if 1) there is a path from n' to n with label-list L and 2) L/a (or L/*) satisfies the path expression p Number of locks: updates: O(1) queries: O(1) Number of locks: updates: O(1) queries: O(1)

24 T h e U n i v e r s i t y o f S o u t h e r n Q u e e n s l a n d Stijn DekeyserGriffith U. Seminar, October ’04 24 Commit scheduler Transactions make requests for operations:Transactions make requests for operations: –Query, Addition, Deletion, Commit, Roll-back Scheduler accepts request only ifScheduler accepts request only if 1) the operation does not fail, and 2) the required locks do not conflict with existing locks On Commit the locks disappear ofOn Commit the locks disappear of –the committing transaction, and –the nodes deleted by the transaction On Roll-back the locks disappear ofOn Roll-back the locks disappear of –the transaction being rolled-back

25 T h e U n i v e r s i t y o f S o u t h e r n Q u e e n s l a n d Stijn DekeyserGriffith U. Seminar, October ’04 25 Conflict Scheduler Scheduler has a Dependency Graph (DG):Scheduler has a Dependency Graph (DG): –arrow t1 --> t2 if a lock of an operation of transaction t1 conflicts with a lock of a preceding operation of t2 Scheduler accepts request only ifScheduler accepts request only if 1) the operation does not fail, and 2) no cycles appear in the DG –A commit of t1 is not accepted if in the DG arrows depart from t1. –A roll-back of t1 leads to a roll-back of t2 if t2 --> t1 in the DG.

26 T h e U n i v e r s i t y o f S o u t h e r n Q u e e n s l a n d Stijn DekeyserGriffith U. Seminar, October ’04 26 Conclusion and Further Research Commit and conflict schedulers guarantee serialisabilityCommit and conflict schedulers guarantee serialisability Complexity is decided by the size of the document / instanceComplexity is decided by the size of the document / instance Is order of children a problem?Is order of children a problem? –simulation –write-write conflicts What with the relocation of subtrees?What with the relocation of subtrees? –Identity of nodes to be taken into account? No use / knowledge of (entire) instance?No use / knowledge of (entire) instance? –Use of DataGuide –Instance Independent CC for SSD


Download ppt "T h e U n i v e r s i t y o f S o u t h e r n Q u e e n s l a n d Stijn DekeyserGriffith U. Seminar, October ’04 1 Towards a new approach to Document Collaboration."

Similar presentations


Ads by Google