[[data-access]]
= Using the GemFire Data Access Namespace

In addition to the core `gfe` namespace, Spring Data GemFire provides a `gfe-data` namespace intended primarily to simplify the development of GemFire client applications. This namespace currently supports for GemFire <<gemfire-repositories,repositories>> and function <<function-execution,execution>> and a `<datasource>` tag that offers a convenient way to connect to the data grid.

[[data-access:datasource]]
== An Easy Way to Connect to GemFire

For many applications, A basic connection to a GemFire grid, using default values is sufficient. Spring Data GemFire's `<datasource>` tag provides a simple way to access data. The data source creates a client cache and connection pool. In addition, it will query the member servers for all existing root regions and create a proxy (empty) client region for each one.

[source,xml]
----
<gfe-data:datasource>
   <locator host="somehost" port="1234"/>
</gfe-data:datasource>
----

The datasource tag is syntactically similar to `<gfe:pool>`. It may be configured with one or more locator or server tags to connect to an existing data grid. Additionally, all attributes available to configure a pool are supported. This configuration will automatically create ClientRegion beans for each region defined on members connected to the locator, so they may be seamlessly referenced by Spring Data mapping annotations, GemfireTemplate, and wired into application classes.

Of course, you can explicitly configure client regions. For example, if you want to cache data in local memory:

[source,xml]
----
<gfe-data:datasource>
   <locator host="somehost" port="1234"/>
</gfe-data:datasource>

<gfe:client-region id="Customer" shortcut="CACHING_PROXY"/>
----

