We have following problem. We have one node in Jboss Cache to store tokens (used for authorization) , each token can have a different expiration date.

I have a feeling that keeping all tokens in one node is not best solution because eviction algorithm works per node basis in our example we would like to use LRUAlgorithm but we cannot use it because as I wrote before all element are in one node (eviction works per-node basis ).

The second solution is to store each token in separate node but in such solution we can have 50000 nodes with one element ! I'm affraid that finding a token (=finding a node instead element) an be very slow because we will look for node instead of element also creating node as I know is not fast operation but in this solution we have to create node each time when token is created.

What is proper solution for our problem? It is a pitty that there is now eviction per element basis