<commit_before>---
title: Region Management
---

<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<a id="data_regions__section_18A9481217204613958897FE64105097"></a>
Operations that create, destroy, invalidate, clear, and change the 
configuration of regions work with gfsh commands, through an XML description,
and via API calls.

You store your data in region entry key/value pairs, with keys and values being any object types your application needs.
The `org.apache.geode.cache.Region` interface implements `java.util.Map`.

Each region's attributes define how the data in the region is stored, distributed, and managed. Data regions can be distributed, partitioned among system members, or local to the member.

*Region shortcuts* identify commonly-used types of regions.
See more information about region shortcuts at [Region Shortcuts](../../reference/topics/chapter_overview_regionshortcuts.html).
for more information about region shortcuts.

**Note:**
If you change attributes that define a region, you must restart the member for the changes to take effect.

#  Creating a Region

###  Creating a Region with gfsh

A simple and fast way to create a data region in the <%=vars.product_name_long%> cache is to use the `gfsh` command-line tool.

Region creation is subject to attribute consistency checks, both internal to the cache and, if the region is not local, between all caches where the region is defined.

The `gfsh create region` [command reference page](../../tools_modules/gfsh/command-pages/create.html) details command line options for creating a region with `gfsh`.

With `gfsh` connected to a JMX server,
an example command that creates a replicated region is

``` pre
gfsh>create region --name=region1 --type=REPLICATE
```

Export the configuration files of your server so that you can save your region's configuration and recreate the region with the same attributes the next time you start up your cache server. See [export config](../../tools_modules/gfsh/command-pages/export.html#topic_C7C69306F93743459E65D46537F4A1EE) for details. 

**Note:**
The cluster configuration service, which is enabled by default, automatically saves the configuration on the locators in the distributed system. After you use the gfsh create region command, any new servers that you start that attach to the same locator receive the same configuration. You can also create alternate configurations within a distributed system by specifying a group when creating the region and starting servers. See [Overview of the Cluster Configuration Service](../../configuring/cluster_config/gfsh_persist.html).


###  Creating a Region Through the cache.xml File<commit_msg>User Guide: Fixed a typo in Basic Config/Data Regions/Region Management<commit_after>---
title: Region Management
---

<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<a id="data_regions__section_18A9481217204613958897FE64105097"></a>
Operations that create, destroy, invalidate, clear, and change the 
configuration of regions work with gfsh commands, through an XML description,
and via API calls.

You store your data in region entry key/value pairs, with keys and values being any object types your application needs.
The `org.apache.geode.cache.Region` interface implements `java.util.Map`.

Each region's attributes define how the data in the region is stored, distributed, and managed. Data regions can be distributed, partitioned among system members, or local to the member.

*Region shortcuts* identify commonly-used types of regions.
See [Region Shortcuts](../../reference/topics/chapter_overview_regionshortcuts.html) for more information.

**Note:**
If you change attributes that define a region, you must restart the member for the changes to take effect.

#  Creating a Region

###  Creating a Region with gfsh

A simple and fast way to create a data region in the <%=vars.product_name_long%> cache is to use the `gfsh` command-line tool.

Region creation is subject to attribute consistency checks, both internal to the cache and, if the region is not local, between all caches where the region is defined.

The `gfsh create region` [command reference page](../../tools_modules/gfsh/command-pages/create.html) details command line options for creating a region with `gfsh`.

With `gfsh` connected to a JMX server,
an example command that creates a replicated region is

``` pre
gfsh>create region --name=region1 --type=REPLICATE
```

Export the configuration files of your server so that you can save your region's configuration and recreate the region with the same attributes the next time you start up your cache server. See [export config](../../tools_modules/gfsh/command-pages/export.html#topic_C7C69306F93743459E65D46537F4A1EE) for details. 

**Note:**
The cluster configuration service, which is enabled by default, automatically saves the configuration on the locators in the distributed system. After you use the gfsh create region command, any new servers that you start that attach to the same locator receive the same configuration. You can also create alternate configurations within a distributed system by specifying a group when creating the region and starting servers. See [Overview of the Cluster Configuration Service](../../configuring/cluster_config/gfsh_persist.html).


###  Creating a Region Through the cache.xml File
{'fraction_non_alphanumeric': 0.06208425720620843, 'fraction_numerical': 0.016851441241685146, 'mean_word_length': 4.76320272572402, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6347263', 'n_tokens_mistral': 1756, 'n_tokens_neox': 1628, 'n_words': 899}