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.
Choose the region shortcut setting that most closely matches your region configuration. See
org.apache.geode.cache.RegionShortcutor Region Shortcuts. To create a replicated region, use one of the
REPLICATEshortcut settings. To create a preloaded region, set your region
cache.xmldeclaration creates a replicated region:
<region-attributes refid="REPLICATE"> </region-attributes>
You can also use gfsh to configure a region. For example:
gfsh>create region --name=regionA --type=REPLICATE
See Region Types.
Choose the level of distribution for your region. The region shortcuts in
RegionShortcutfor distributed regions use
distributed-ackscope. If you need a different scope, set the
<region-attributes refid="REPLICATE" scope="distributed-no-ack"> </region-attributes>
If you are using the
distributed-ackscope, optionally enable concurrency checks for the region.
<region-attributes refid="REPLICATE" scope="distributed-ack" concurrency-checks-enabled="true"> </region-attributes>
If you are using
globalscope, program any explicit locking you need in addition to the automated locking provided by Tanzu GemFire.
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.