-
1. Re: Auction System with Infinispan
galder.zamarreno Nov 10, 2011 6:05 AM (in response to ynusis)1 of 1 people found this helpfulIf you want to do querying, you can do it with our map/reduce framework, or using the query module:
https://docs.jboss.org/author/display/ISPN/Querying+Infinispan
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
-
2. Re: Auction System with Infinispan
vblagojevic Nov 10, 2011 10:29 AM (in response to ynusis)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?
Michael,
Can you elaborate a bit more what you are trying to achieve?
Regards,
Vladimir
-
3. Re: Auction System with Infinispan
ynusis Nov 10, 2011 12:36 PM (in response to vblagojevic)imagine this scenario:
two entities:
- auction
attributes: id, name, user_id
- bid
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.
-
4. Re: Auction System with Infinispan
vblagojevic Nov 10, 2011 1:58 PM (in response to ynusis)Hey,
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,
Vladimir
-
5. Re: Auction System with Infinispan
sannegrinovero Nov 10, 2011 7:31 PM (in response to vblagojevic)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.
-
6. Re: Auction System with Infinispan
ynusis Nov 14, 2011 2:26 AM (in response to sannegrinovero)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!