Space Persistency
The Space Where GigaSpaces data is stored. It is the logical cache that holds data objects in memory and might also hold them in layered in tiering. Data is hosted from multiple SoRs, consolidated as a unified data model. Persistency is provided via a component called External Data Source. This component provides persistency capabilities for the space architecture to interact with a persistency layer:
- Pre-loading data from the persistency layer and lazy load data from the persistency (available when the Space is running in LRU Last Recently Used. This is a common caching strategy. It defines the policy to evict elements from the cache to make room for new elements when the cache is full, meaning it discards the least recently used items first. mode).
- Delegating changes within the Space to the persistency layer.
GigaSpaces Space Persistency provides the AbstractExternalDataSource
class, which can be extended and then used to load and store data into an existing data source. Data is loaded from the data source during Space initialization, and from then onwards the application works directly with the Space.
Persistency can be configured to run in Synchronous or Asynchronous mode:
Synchronous persistency mode is deprecated and will be removed in a future GigaSpaces product release. Use Asynchronous Persistency mode instead.
-
Synchronous Mode - see Direct Persistency
-
Asynchronous Mode - see Asynchronous Persistency with the Mirror
The difference between Synchronous and Asynchronous persistency mode is the way that data is persisted back to the database. In Synchronous mode, data is persisted immediately after the operation is conducted where the client application waits for the ExternalDataSource
to confirm the write. In Asynchronous mode (mirror Service), data is persisted in a reliable asynchronous manner using the mirror Service as a write-behind activity. This mode provides maximum performance.
Space Persistency API
The Space Persistency API contains an abstract class that should be extended in order to customize the Space persistency functionality. The ability to customize the Space persistency functionality allows GigaSpaces to interact with any external application or data source.
Client Call | External Data Source Call | Cache Policy Mode | EDS Usage Mode |
---|---|---|---|
Write , Change , Take , WriteMultiple , TakeMultiple , Clear |
ExecuteBulk
|
ALL_IN_CACHE, LRU | read-write |
Transaction Commit
|
ExecuteBulk
|
ALL_IN_CACHE, LRU | read-write |
Read , ReadMultiple , ReadById , ReadByIds , Count |
GetEnumerator
|
LRU | read-write,read-only |
TakeMultiple
|
GetEnumerator
|
ALL_IN_CACHE, LRU | read-write |
For detailed API information, see the External Data Source API page.
GigaSpaces comes with a built-in implementation of AbstractExternalDataSource
called NHibernate Space Persistency.
Refer to Space Persistency Initial Load for information on how to allow the Space to pre-load its data.