Configure Region Persistence and Overflow

Plan persistence and overflow for your data regions and configure them accordingly.

Use the following steps to configure your data regions for persistence and overflow:
  1. Configure your disk stores as needed. See Design and Configure Disk Stores. The cache disk store defines where and how the data is written to disk.
    <disk-store name="myPersistentStore" . . . >
    <disk-store name="myOverflowStore" . . . >
  2. Specify the persistence and overflow criteria for the region. If you are not using the default disk store, provide the disk store name in your region attributes configuration. To write asynchronously to disk, specify disk-synchronous="false".
    • For overflow, specify the overflow criteria in the region's eviction-attributes and name the disk store to use.
      Example:
      <region name="overflowRegion" . . . >
        <region-attributes disk-store-name="myOverflowStore" disk-synchronous="true">
          <eviction-attributes>
            <!-- Overflow to disk when 100 megabytes of data reside in the
                 region -->
            <lru-memory-size maximum="100" action="overflow-to-disk"/>
          </eviction-attributes>
        </region-attributes>
      </region>
    • For persistence, set the data-policy to persistent-replicate and name the disk store to use.
      Example:
      <region name="partitioned_region" refid="PARTITION_PERSISTENT">
        <region-attributes disk-store-name="myPersistentStore">
          . . . 
        </region-attributes>
      </region> 

When you start your members, overflow and persistence will be done automatically, with the disk stores and disk write behaviors.

Related Topics
com.gemstone.gemfire.cache.RegionAttributes for data region persistence information
Persisting Data to Disk Example
com.gemstone.gemfire.cache.EvictionAttributes for data region overflow information
Overflowing Data to Disk Example
com.gemstone.gemfire.cache.server.ClientSubscriptionConfig
com.gemstone.gemfire.cache.util.GatewayQueueAttributes