Query using predicate with two maps

222 views
Skip to first unread message

Raghu Sarma

unread,
Jan 10, 2012, 9:46:29 PM1/10/12
to Hazelcast
Is there a way to query two maps -- like a join that gemfire allows
across two regions (maps)? I don't see a way to do that.

Talip Ozturk

unread,
Jan 11, 2012, 3:08:54 AM1/11/12
to haze...@googlegroups.com
Hazelcast doesn't support joins. Not sure about GemFire. Can you email
the documentation url? I just looked for it and found this:
http://pubs.vmware.com/vfabric5/index.jsp?topic=/com.vmware.vfabric.gemfire.6.6/developing/querying_basics/querying_partitioned_regions.html

"Joins and cross-region queries are not allowed - between separate
partitioned regions, or between a partitioned region and any other
region.
No region other than the partitioned region can be referenced in the query."

Hazelcast always partitions your data and you cannot do join across
multiple maps. But you can use data affinity feature to collocate
related data so that you can send a query execution on each member to
query each local collocated portion.
http://hazelcast.com/docs/1.9.4/manual/single_html/#DataAffinity
http://hazelcast.com/docs/1.9.4/manual/single_html/#DistributedExecution


-talip

On Wed, Jan 11, 2012 at 4:46 AM, Raghu Sarma <r.s...@mac.com> wrote:
> Is there a way to query two maps -- like a join that gemfire allows
> across two regions (maps)? I don't see a way to do that.
>

> --
> You received this message because you are subscribed to the Google Groups "Hazelcast" group.
> To post to this group, send email to haze...@googlegroups.com.
> To unsubscribe from this group, send email to hazelcast+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/hazelcast?hl=en.
>

Raghu Sarma

unread,
Jan 11, 2012, 8:58:02 AM1/11/12
to Hazelcast
Thank you for your quick response.
Here are some examples of "joins" and other type of queries across
regions (maps)
Topic: http://pubs.vmware.com/vfabric5/topic/com.vmware.vfabric.gemfire.6.6/developing/querying_basics/example_data_and_runs.html
I understand, however, that these won't work when you partition the
data and since hazelcast would always be partitioned it would be an
issue.

The data for my use case is not large and I did not intend to
partition the data (if I were to use gemfire for example). I expect
the data to change very rapidly (market data) hence a caching solution
with querying (map/reduce) features would work very well as I would
run into too many contention issues with a traditional datastore
(rdbms).

Hazelcast would still work if I flatten out the data into one map but
that may be problematic for my usecase.

Thanks.
Reply all
Reply to author
Forward
0 new messages