Bitemporal with Arangodb

178 Views Asked by At

Are there any patterns or examples available for doing bitemporal modelling with ArangoDB? I am evaluating my options for choosing a database and ArangoDB seems to have the required features.

Lars

1

There are 1 best solutions below

0
On BEST ANSWER

No, we currently don't know existing examples of how to do that in Arangodb.

However, Reading over the code project article about Bitemporal Database Design You would do similar in ArangoDB - have two attributes with start and end-date.

The problem of this aproach would however be, that you can't combine a range over two attributes in one skiplist index. One could probably work around this by specifying a range on the start attribute to be within a query range. A second filter would then sort out the documents that don't fulfill the end timestamp:

FOR item IN testCollection 
   FILTER item.startTime < @startTimeMin AND item.startTime > @startTimeMax 
   FILTER item.endTime < @endTimeMax
  RETURN item

With the bind values:

{
  startTimeMin: '2016.01.15',
  startTimeMax: '2016.01.30',
  endTimeMax: '2016.01.25
 }

However, if you could be a bit more detailed about your usecase, probably a more precise answer can be made.