This topic explains how to configure data persistence and overflow for your data regions in VMware Tanzu GemFire.

Use the following steps to configure your data regions for persistence and overflow:

  1. Configure your disk stores as needed. See Defining and Configuring 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>
      

      Notes: - For partitioned regions, if the partition region attribute local-max-memory is set, then the eviction attribute lru-memory-size maximum is overwritten with the value
      of local-max-memory. Both local-max-memory and lru-memory-size maximum are local member attributes and not cluster-wide. - You cannot configure lru-memory-size using gfsh.

    • 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.

Note: You can also configure Regions and Disk Stores using the gfsh command-line interface. See Region Commands and Disk Store Commands.

Related Topics
org.apache.geode.cache.RegionAttributes for data region persistence information
org.apache.geode.cache.EvictionAttributes for data region overflow information
org.apache.geode.cache.server.ClientSubscriptionConfig
check-circle-line exclamation-circle-line close-line
Scroll to top icon