Ignite Persistence
Apache Ignite Distributed Persistent Store
Ignite native persistence is a distributed ACID and SQL-compliant disk store that transparently integrates with Ignite's durable memory. Ignite persistence is optional and can be turned on and off. When turned off Ignite becomes a pure in-memory store.
With persistent store enabled, you no longer need to keep all the data and indexes in memory, or warm it up after a node or cluster restart because Ignite Durable Memory is tightly coupled with the Persistent Store and treats it as a secondary storage. This implies that if a subset of data or an index is missing in RAM, the durable memory will take it from disk.
A detailed overview is given in the respective Java documentation.
Usage
To enable the distributed Persistent Store, set the IgniteConfiguration.PersistentStoreConfiguration property:
var cfg = new IgniteConfiguration
{
DataStorageConfiguration = new DataStorageConfiguration
{
DefaultDataRegionConfiguration = new DataRegionConfiguration
{
Name = "defaultRegion",
PersistenceEnabled = true
},
DataRegionConfigurations = new[]
{
new DataRegionConfiguration
{
// Persistence is off by default.
Name = "inMemoryRegion"
}
}
},
CacheConfiguration = new[]
{
new CacheConfiguration
{
// Default data region has persistence enabled.
Name = "persistentCache"
},
new CacheConfiguration
{
Name = "inMemoryOnlyCache",
DataRegionName = "inMemoryRegion"
}
}
};
<igniteConfiguration>
<dataStorageConfiguration>
<!-- Enable persistence for all caches by default. -->
<defaultDataRegionConfiguration name="defaultRegion" persistenceEnabled="true" />
<!-- Define custom region without persistence. -->
<dataRegionConfigurations>
<dataRegionConfiguration name="inMemoryRegion" />
</dataRegionConfigurations>
</dataStorageConfiguration>
<cacheConfiguration>
<!-- Default region is persistent. -->
<cacheConfiguration name="persistentCache" />
<!-- Custom cache without persistence. -->
<cacheConfiguration dataRegionName="inMemoryRegion" name="inMemoryOnlyCache" />
</cacheConfiguration>
</igniteConfiguration>
Once the Persistent Store is enabled, all the data as well as indexes will be stored both in memory and on disk across all the cluster nodes.
When Apache Ignite sees that the store is enabled, it moves the cluster from active to inactive state making sure that applications can not modify the data until allowed. This is done to avoid situations where the cluster is being restarted and applications start modifying data that might be persisted on the nodes that have not been brought back up yet. So, the general practice here is to wait while all the nodes join the cluster and call IIgnite.SetActive(true) from any node or application you have, moving the cluster to the active state.
Persistent Store Root Path
By default, all the data is persisted in the Apache Ignite working directory (
IGNITE_HOME\work). UsePersistentStoreConfiguration.PersistentStorePathproperty to change the default directory.
Updated almost 5 years ago
