Difference between SNAPSHOT and CURRENT TimeScope in ActiveSpaces - BrowserDef.

Difference between SNAPSHOT and CURRENT TimeScope in ActiveSpaces - BrowserDef.

book

Article ID: KB0093100

calendar_today

Updated On:

Products Versions
TIBCO ActiveSpaces -
Not Applicable -

Description

Resolution:
SNAPSHOT provides 'temporal isolation' for the result set of the browser. With it the browser will return the list of tuples that were present in the space at the time the browser was created.  If the data is changed while the application that created the browser is iterating through the result set, with SNAPSHOT you still get the data exactly as it was at browser creation time. However, creating this 'snapshot in time' of the result set requires some work (and memory) both on the seeders and on the client application, especially if the result set in question is large.

In contrast, CURRENT does not provide temporal isolation but requires very little resources (both on the seeders and clients) and may throw an exception and need to be restarted if there is a change in the number of seeders of the space.

Example:

Time0->Browser created (tuples 1 and 2 match the filtering criteria).

Time1->Application calls next() to start retrieving the matching tuples, receives tuple 1.

Time2->Some other application deletes (or modifies) Tuple 2.

With SNAPSHOT:

Time3->Application calls next() again. It receives Tuple 2, exactly as that tuple was at Time0.

With CURRENT:

Time3->Application calls next() again. It receives the _modified_ version of Tuple 2 (or null, if Tuple 2 was deleted).


Main differences are

  • When the query returns a very large result set, the amount of memory required by the seeders and the querying application to provide true SNAPSHOT functionality may become a problem. In this case, you can use the CURRENT time scope instead.
  • SNAPSHOT shows you the state of the Space at the time the browser is created, so is not affected by later changes to the Space, such as a seeder joining/leaving the space or a Tuple being changed.
  • In comparison, the CURRENT time scope is a lightweight, best effort version of the snapshot time scope that requires almost no extra memory and very little initial processing. But where changes in the space done after a browser was created with a current time scope, may or may not be visible.
  • With the CURRENT timescope, if the Space has a HASH index, the HASH index might return duplicate values if there is a need to grow the hash index used with a seeder. If duplicate values are an issue, it is advisable to switch to the TREE index type.
  • CURRENT is a fast and more efficient way (uses much less memory) to browse large data sets compared with SNAPSHOT.
  • CURRENT can throw an exception if a seeder joins/leaves while the the Current browser is being created or is in use.

Issue/Introduction

Difference between SNAPSHOT and CURRENT TimeScope in ActiveSpaces - BrowserDef.