This content has been marked as final.
Show 1 reply
-
1. Re: Distributed counters in Infinispan
an1310 Aug 28, 2012 10:49 AM (in response to hsn10)Hi Radim,
I've implemented something similar in my application. It's actually pretty easy and very performant if you use the distributed executor framework. Here are some rough guidelines:
- You assuredly will either need a lock/increment/release pattern to get counter values. However, if you execute a task on the data owner, you're acquiring local locks.
- You will need to look at the cache configuration options for eager locks.
- You may want to consider allocating "chunks" of possible counter values for your clients to use locally. This will reduce contention on the cache, while guaranteeing uniqueness.
- (Don't forget about overflow conditions)