1 of 1 people found this helpful
If you want to do querying, you can do it with our map/reduce framework, or using the query module:
I'll let one of my colleagues answer the map/reduce specific question.
WRT continous queries, there was some experimental work done on this area: http://community.jboss.org/docs/DOC-15963 - However, we are not currently maintaining it, so if you're interested, use it at your own risk
Michael Wittig wrote:
I am playing a bit with Infinispan (came from CouchDB) and wonder how I can achieve something like this:
get me all the Objects where userid=1
Because of Infinispans Map/Reduce allows only the output of one element. In CouchDB it is possible to make only a map without a reduce with more than one object for a key as result. How can I do this in Infinispan?
Can you elaborate a bit more what you are trying to achieve?
imagine this scenario:
attributes: id, name, user_id
attributes: id, auction_id, limit, user_id
so how can I achieve this:
- get all auctions from user with the id x
- get all bids for auction with the id y
It is important that this queries runs vey very fast. so i thought that this map/reduce thing could be best option.
another use case is, that every time A new bid is entered into the system I have to check if this bid is higher than the last bid. so I though about the continous query stuff.
gives this a better idea of what I want to do? the whole thing is just a litte project to get to know Infinispan.
Does not seem like a map/reduce use case but rather a query use case. I'll ask Sanne to give it a look.
All the best,
So generally using Map/Reduce is the most efficient approach to apply some transformation/query to all values in the grid; but being the most efficient doesn't make it "faster" in terms of latency or overall performance.
If what you need is very fast search, indexing it using Infinispan Query is likely the best choice; it will also make writes/updates slower as the index needs to be updated, so it's a tradeoff: you have to make a choice. Once the index is in place, solving your specific use case will be more efficient than a Map/Reduce collector as using the index it won't need to iterate on all nodes in the grid but will know in advance where the needed data is.
ok. thank you very mutch for your help. I will try to setup a small test project and then I came back with my results. Thx!