XML Store Christian Theil Have, [email protected]@itu.dk René Kofoed, [email protected]@itu.dk...
-
date post
21-Dec-2015 -
Category
Documents
-
view
219 -
download
0
Transcript of XML Store Christian Theil Have, [email protected]@itu.dk René Kofoed, [email protected]@itu.dk...
XML Store
Christian Theil Have, [email protected]é Kofoed, [email protected]
References: Kasper Pedersen & Jesper Pedersen, Value-oriented XML StoreMads Pultz, Garbage Collection in Distributed Value-Oriented Storage System
XML Store overview XML store
Stores values Name service
Like a DNS service
XML Store overview What’s in an XML store
Values Value references
XML store helps you to store values, and locating them again with references.
What’s a value ? A piece of data of some sort, maybe the
number 5 :) Are 5 and 5 and 5 the same values? Nope – there is only one value: 5 The other 5 and 5 are occurences of the
first 5.
What’s a value reference? A shortname for a value :) A shortname is shorter than the data being
stored.
Value references
to xml or not to xml
<speech><speaker>BBCD01</speaker>
<line>BBCD02</line></speech>
Hamlet
Values
Value references
Shared valuesDocument A<speech>
<speaker>BBCD01</speaker>
<line>BBCD02</line></speech>
Hamlet
Document B<speech>
<speaker>BBCD01</speaker>
<line>BBCD03</line></speech>
to be
or not to be
Shared value
And updates? By changing speaker: ”Hamlet” in
document A, will also change document B This will be problematic!
Therefore…. Perform non-destructional updates by:
Creating a new value in a new tree Replacing existing references to the old value
to point to the new value
Changing Hamlet to OpheliaDocument A<speech>
<speaker>BBCD01</speaker>
<line>BBCD02</line></speech>
Document A’<speech>
<speaker>BBCD04</speaker>
<line>BBCD03</line></speech>
Hamlet
Document B<speech>
<speaker>BBCD01</speaker>
<line>BBCD03</line></speech>
Ophelia
XML - format for representing tree-structured data XML models:
Document Object Model (DOM) - loads the entire document into memory in order to manipulate it.
XML Enabled Databases (XED) – stores XML data in an existing relational database.
Native XML Databases – internal model designed for persisting XML
Document Value Model DVM – a way to program XML centric applications
Implementations 1. Based on Chord 2. Based on IP-multicast
Uses locators and a reference server to map a value reference to a location independant value.
XMLStore architechture Overview
Layered architechture Application layer DVM layer Disk layer
A concrete XMLStore is build with plugable modules.
Layers in XMLStore
”SPEECH”Name server:
6FE02A
42.63.145.108:6949/XAA/42,8
<speaker>5A7012,87D311</speaker>
Value reference(hashed value)
Lookup (p2p routing)
load
Locator
Value
Lookup
Document
XMLStore
Modules (1)XMLStore is organized in a modular way.
Funtionality can be added using decorators:
LoadSave
9A01F0451234
Save Load
Spawnsthread
Modules (2)Example modules:
Buffering Caching Asynchronous operation Replication (peer-to-peer) distribution Garbage collection
Name service Binds a human readable name to a value reference. Must provide provide destructive updates
Lost update problem Pessimistic locking Optimistic concurrency control
Should be Atomic
Distributed name service
Garbage collection in XMLStore Problem: Since values cannot be deleted
from XMLStore, it could eventually be flooded.
The solution: Garbage collection!
Garbage collection in XMLStore is concerned with reclaiming values that cannot be reached using references.
Garbage collection Live values - can be reached using an existing value
reference. The existing value references comprise the ”Root set”
Mutator – A program that accesses memory Collector – The garbage collector Local vs. Global garbage collection Different approaches
Reference counting Reference listing Tracing
Garbage collection1234F0459A01
<a>F3B2</a>”foo””bar”
FF01 ”foobar”
Name server
9A01F0451234
……
F3B2FF01F3B2
……
111
11
F3B2 … 0
Stub Skeleton
Reference count
Garbage collection XMLStore needs extended API to to keep track
of value references.
Garbage collection Reference counting
Basic idea: count the number of references to a given object, and reclaim it when the count reaches zero.
A reference count is associated with each value occurence
Scales well Doesn’t prevent cycles
This is not a problem since XMLStore contains only acyclic data structures
No resilience to lost messages Low fault tolerance
Garbage collection Reference listing
Each value occurence has a separate skeleton for each client…
Mapping of peers to value references
F3B2
Client A
Client B
Peer
hamlet
Skeleton
Garbage collection Tracing
Live objects are recursively traced from the roots and unreachable objects are determined to be garbage
Stop-and-collect vs. Incremental collection Group based tracing Pros and cons
Can detect cycles Scalability issues
Approach adapted for xmlstore
Local garbage collection Reference listing Tracing (copying collector)
.. So cycles can be collected (only relevant with cells/mutable data)
Global garbage collection Tracing
Summary