Chapter 7. Remote Querying


Red Hat JBoss Data Grid's Hot Rod protocol allows remote, language neutral querying.
Two features allow this to occur:
The Infinispan Query Domain-specific Language (DSL)

JBoss Data Grid uses its own query language based on an internal DSL. The Infinispan Query DSL provides a simplified way of writing queries, and is agnostic of the underlying query mechanisms. Querying via the Hot Rod client allows remote, language-neutral querying, and is implementable in all languages currently available for the Hot Rod client.

The Infinispan Query DSL is essential for performing remote queries, but can be used in both embedded and remote mode.
Protobuf Encoding

Google's Protocol Buffers is used as an encoding format for both storing and querying data. The Infinispan Query DSL can be used remotely via the Hot Rod client that is configured to use the Protobuf marshaller. Protocol Buffers are used to adopt a common format for storing cache entries and marshalling them.

Remote clients that need to index and query their stored entities must use the Protobuf encoding format. It is also possible to store Protobuf entities for the benefit of platform independence without indexing enabled if it is not required.

7.1. Querying Comparison

In Library mode, both Lucene Query-based and DSL querying is available. In Remote Client-Server mode, only Remote Querying using DSL is available. The following table is a feature comparison between Lucene Query-based querying, Infinispan Query DSL and Remote Querying.
Table 7.1. Embedded querying and Remote querying
Feature Embedded Querying and Lucene Query Embedded DSL Remote Querying
Indexing
Mandatory
Optional but highly recommended
Optional but highly recommended
Index contents
Selected fields
Selected fields
Selected fields
Data Storage Format
Java objects
Java objects
Protocol buffers
Keyword Queries
Yes
Yes
Yes
Range Queries
Yes
Yes
Yes
Fuzzy Queries
Yes
No
No
Wildcard
Yes
Limited to like queries (Matches a wildcard pattern that follows JPA rules).
Limited to like queries (Matches a wildcard pattern that follows JPA rules).
Phrase Queries
Yes
No
No
Combining Queries
AND, OR, NOT, SHOULD
AND, OR, NOT
AND, OR, NOT
Sorting Results
Yes
Yes
Yes
Filtering Results
Yes, both within the query and as appended operator
Within the query
Within the query
Pagination of Results
Yes
Yes
Yes
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.