A feature of the in-memory data store provided by Tanzu GemFire is the ability to query the data.

Queries are specified in the OQL language. OQL syntax and semantics are similar to SQL. See the Pivotal GemFire section on Querying for details on the OQL language.

Queries can be initiated through an API call of Region.query() or through the gfsh query command.

All queries are executed on the servers holding the region data. Take care not to overwhelm the resources when specifying queries. For example,

SELECT * FROM /trades

returns all values in the trades region. For a large region (millions of entries), the resources of server processing and memory needed to gather and return the data set may be considerable. Consider the processing and data set size when specifying queries.

There are a set of example apps within the GitHub node-examples repository. The query example introduces querying. The example’s README.md file contains instructions on how to run the example. This stripped-down app contains the minimum code necessary to run in a local development environment with a GemFire cluster.