You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »


Table of Contents


Data Structure Approaches

 

  In-memory Processing 
Triple Store Data StructureIn-memory Data StructureDirect
access
at
loaded
position
Direct
access
URI as ID
(pre-loaded)
Iteration
foward

Iteration
backward

Append
after
last
loaded

Append
after
global
last
Insert
after
loaded
item
Insert
before
loaded
item
Insert
after
loaded
position
Insert
before
loaded
position
Delete
loaded
item
Delete
from
loaded
position
Fetch
one by
global
position

Fetch
one by URI

Fetch
range
Fetch
next
range
Persist
one at
global
position
Persist
one by
URI
Persist
range
List
size
Comments
doubly linked list                      
 doubly linked listNOSLOWFASTFASTFASTFASTFASTFASTNONOFASTNONOFASTSLOWSLOWNOFASTSLOWNO 
 convert to array on fetchFASTSLOWFASTFASTFASTFASTFASTFASTFASTFASTFASTFASTNOFASTSLOWSLOWNOFASTSLOWNO 
 convert to hash on fetchNOFASTFASTFASTFASTFASTFASTFASTNONOFASTNONOFASTSLOWSLOWNOFASTSLOWNOkey=proxy URI
doubly linked list + order index                      
 doubly linked listSLOWSLOWFASTFASTSLOWSLOWSLOWSLOWSLOWSLOWSLOWSLOWSLOWFASTFASTSLOWSLOWFASTSLOWFAST 
 convert to array on fetchFASTSLOWFASTFASTSLOWSLOWSLOWSLOWSLOWSLOWSLOWSLOWSLOWFASTFASTSLOWSLOWFASTSLOWFAST 
 convert to hash (key=proxy URI) on fetchSLOWFASTFASTFASTSLOWSLOWSLOWSLOWSLOWSLOWSLOWSLOWSLOWFASTFASTSLOWSLOWFASTSLOWFASTkey=proxy URI

 

Analysis of Triple Store Data Structure
Triple Store Data StructureProsConsComments
doubly linked list+ all updates effect at most 3 items (i.e., prev, current, and next)- requires traversal of links during fetch (i.e. fetch each item individually - one query for each item) 
doubly linked list + order index+ much faster fetch retrieving all items in a range (i.e., single query gets all items)- adding/removing items from list can be very slow when item is early in the list (worst case touches all list items) 

 

Analysis of In-memory Data Structure
In-memory Data StructureProsConsComments
doubly linked list+ least amount of processing during fetch (probably not significant relative to overall processing required)- iteration requires traversing next links 
convert to array on fetch

+ allows for fast access by position to loaded items
+ faster iteration than traversing next links (may not be significant)

  
convert to hash on fetch+ allows for fast fast access by proxy URI to loaded items- iteration requires traversing next links

I anticipate the need to have direct access by proxy URI more than positional.

 

 


List Header Info

The list header info will be a hash.  It holds information about the list as a whole and the currently loaded range of items as a sub-structure.  The values for the list information stored depends on the type of the loaded items sub-structure.  The loaded items sub-structure holds items as a group are in-memory using one of four possible grouping methods: doubly linked lists, doubly linked lists + order index, array, or hash with proxy URI as the key.  NOTE: Order index is global to the entire list.  The array and hash implementations may also have this global order index information stored with the item info.

 

  example value typesComments
keydescription of valuedoubly
linked
doubly
linked
+ order
arrayhash 
firstpointer to first item in listURI of first proxyURI of first proxyURI of first proxyURI of first proxy 
lastpointer to last item in listURI of last proxyURI of last proxyURI of last proxyURI of last proxy 
countcount of all items in listXlast.indexlast.indexlast.indexCount for full list is available for array and hash when order index is stored in triplestore.
first_loadedpointer to first item in loaded range of itemsitemitemarray[0]URI of
first loaded proxy
 
currentpointer to current itemitemitemint cposURI of
current proxy
  • points to first item on fetch
  • updated to next/prev item during traversal
  • points to last modified item when changes are made
last_loadedpointer to last item in loaded range of itemsitemitemarray[size of array]URI of
last loaded proxy
 
count_loadedcount of items in currently loaded rangeX=position of last
- position of first
size of arraysize of hash 
resume_tokenpointer to item after last_loadedURI of proxyURI of proxyURI of proxyURI of proxy 
loaded_itemspointer to loaded itemsuse first_loadeduse first_loadedarrayhash 

 

List Item Info

Each item's info is stored in a hash.  It holds information about the individual item.  The loaded items as a group are in-memory using one of four possible grouping methods: doubly linked lists, doubly linked lists + order index, array, or hash with proxy URI as the key.

  example value types 
keydescription of valuedoubly
linked
doubly
linked
+ order
arrayhashComments
uriURI of proxy for this itemURI of this proxyURI of this proxyURI of this proxyURI of this proxyThis is the hash key for loaded_items when the list is implemented as a hash.
prevpointer to previous item in listURI of prev proxyURI of prev proxy= p - 1URI of prev proxy 
nextpointer to next item in listURI of next proxyURI of next proxy= p + 1URI of next proxy 
prev_loadedpointer to previous item in loaded range of itemsprev itemprev item= pl - 1URI of prev proxy 
next_loadedpointer to next item in loaded range of itemsnext itemnext item= pl + 1URI of next proxy 
proxyForURI of list item being aggregatedURIURIURIURI 
proxyInURI of list aggregationURI of
aggregation
URI of
aggregation
URI of
aggregation
URI of
aggregation
 
proxyIn_loadedpointer to List Headerheaderheaderheaderheader 
position (p)position in full listXpppPosition in full list is available for array and hash when order index is stored in triplestore.
position_loaded (pl)position in loaded range of itemsXplplX 

 

 


 

 

 

  • No labels