|
OverviewThis section describes how the CacheLoader/Store Interface works in both partitioned and replicated clustered spaces.
Partitioned Clustered SpaceRead-Through in Partitioned Clustered Space
The two diagrams above illustrate how a client application reads from a partitioned clustered space, where the actual data is loaded from a distributed or a central data source or other external application. The total of data stored inside the clustered space is divided into two physical partitions, each in a different JVM, where one of the fields value hashcode inside the Entry determines the partition that stored the Entry. Each Entry stored inside the primary partition is backed up in a separate dedicated space for continuous uninterrupted operation in case of "hot failover". In any case, the data is also stored in the database. Each space partition has a CacheLoader implemented allows the space to load relevant data from the database.
The operation proceeds in two stages:
Similarly, object B is read first from Partition 2 using a relevant template. If it is not found, it is read from the database by the partition's CacheLoader.load method.
Write-Through in Partitioned Clustered Space
The two diagrams above illustrate how a client application writes to a partitioned clustered space and persists the data in a distributed or central database, or another external application. Each partition has a CacheStore implementation that provides the space the ability to store the data into the database. The operation proceeds in two stages:
Similarly, object B is written first to Partition 2, backed up in the dedicated space in JVM 4, and written to the database by the partition's CacheStore.store method.
A partitioned space using the CacheLoader/Store implementation with a central database should have the following displayed when started: Life-cycle properties:
Supports inheritance: true
Supports versioning: false
schema-xml configuration:
<persistent>
<CacheLoaderClass>com.gigaspaces.hibernate.HibernateCacheStoreImpl</CacheLoaderClass>
<StorageAdapterClass>com.j_spaces.sadapter.cache.CacheAdapter</StorageAdapterClass>
<entity-class></entity-class>
</persistent>
cluster-xml configuration:
<cache-loader>
<external-data-source>true</external-data-source>
<central-data-source>true</central-data-source>
</cache-loader>
Replicated Clustered SpaceThis section shows how the CacheLoader/Store interface works in a replicated clustered space. Read-Through in Replicated Clustered Space
The two diagrams above illustrate how a client application reads from a replicated clustered space where the actual data is loaded from a distributed or a central data source or another external application. Each space has a CacheLoader implementation that provides the space the ability to load data from the database when it is not found inside the space. The operation proceeds in two stages:
Write-Through in Replicated Clustered Space
Once the backup space becomes active and applications can access it directly, it will load data from the database using its own CacheLoader implementation. This ensures data coherency and provides better performance. In both configurations, when data is loaded into the active space from the database using its CacheLoader, the loaded Entries are not replicated into replica spaces. ConfigurationWhen a clustered space is using the CacheStore/Loader implementation, you should start all nodes using the following property: com.gs.cluster.cache-loader.external-data-source=true
When a clustered space is using Central for all nodes, you should start all nodes using the following property: com.gs.cluster.cache-loader.central-data-source=true
When a clustered space is using different database instances for each space instance, you should start each node using the following property: com.gs.cluster.cache-loader.central-data-source=false
|
Wiki Content Tree
Your Feedback Needed!
We need your help to improve this wiki site. If you have any suggestions or corrections, write to us at techw@gigaspaces.com. Please provide a link to the wiki page you are referring to.





Add Comment