Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Data Structure Approaches

 

SLOWSLOWSLOW
   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
IssuesORE ComplianceComments
doubly linked list                        
 doubly linked listNOSLOWFASTFASTFASTFASTFASTFASTNONOFASTNONOFASTSLOWSLOWNOFASTSLOWNO  

YES

 
 convert to array on fetchFASTSLOWFASTFASTFASTFASTFASTFASTFASTFASTFASTFASTNOFASTSLOWSLOWNOFASTSLOWNO  YES 
 convert to hash (key=proxy URI) on fetchNOFASTFASTFASTFASTFASTFASTFASTNONOFASTNONOFASTSLOWSLOWNOFASTSLOWNO  YESkey=proxy URI 
doubly linked list + order index                        
 doubly linked listSLOWSLOWFASTFASTSLOWSLOWSLOWSLOWSLOWSLOWSLOWSLOWSLOWFASTFASTSLOWSLOWFASTSLOWFAST  YES 
 convert to array on fetchFASTSLOWFASTFASTSLOWSLOWSLOWSLOWSLOWSLOWSLOWSLOWSLOWFASTFASTSLOWSLOWFASTSLOWFAST  YES 
 convert to hash (key=proxy URI) on fetchSLOWFASTFASTFASTSLOWSLOWSLOWSLOWSLOWSLOWSLOWSLOWSLOWFASTFASTSLOWSLOWFASTSLOWFAST YESkey=proxy URI

 

...

Analysis of Triple Store Data Structure
Triple Store Data StructureProsConsComments
doubly linked list+ all updates effect at most 3 items (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 the range with a single query- 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.

 NOTE: All operations are available by adding order index to each proxy for the list as a triple in the triplestore, but most operations that change the list become very slow as it requires updates to all items after the effected item.  Delete could be made fast be allowing for missing index values, but then list size becomes a slow operation.

List Header Info

Lists with headers will hold the following information.

...