Configure Distributed, Replicated, and Preloaded Regions

Plan the configuration and ongoing management of your distributed, replicated, and preloaded regions, and configure the regions.

Before you begin, understand Basic Configuration and Programming.
  1. Choose the region shortcut setting that most closely matches your region configuration. See com.gemstone.gemfire.cache.RegionShortcut. To create a replicated region, use one of the REPLICATE shortcut settings. To create a preloaded region, set your region data-policy to preloaded. This cache.xml declaration creates a replicated region:
    <region-attributes refid="REPLICATE"> 
  2. Choose the level of distribution for your region. The region shortcuts in RegionShortcut for distributed regions use distributed-ack scope. If you need a different scope, set the region-attributes scope to distributed-no-ack or global.
    <region-attributes refid="REPLICATE" scope="distributed-no-ack"> 
  3. If you are using the distributed-ack scope, optionally enable concurrency checks for the region.
    <region-attributes refid="REPLICATE" scope="distributed-ack" concurrency-checks-enable="true"> 
  4. If you are using global scope, program any explicit locking you need in addition to the automated locking provided by GemFire.

Local Destroy and Invalidate in the Replicated Region

Of all the operations that affect the local cache only, only local region destroy is allowed in a replicated region. Other operations are not configurable or throw exceptions. For example, you cannot use local destroy as the expiration action on a replicated region. This is because local operations like entry invalidation and destruction remove data from the local cache only. A replicated region would no longer be complete if data were removed locally but left intact.