2 Replies Latest reply on Oct 13, 2008 7:03 AM by janbols

    Caching collection of items

    janbols

      Hi,
      if we want to cache a collection of a couple of 100's of objects in jBossCache, what would be the best thing to do in terms of performance:


      1. Put the entire list under in the map of a node in the cache. E.g.
        cache.put(fqn, "myList", list);
        This means each time an item is added to the collection, the entire collection needs to be replicated, right?
      2. Create an entry in the map of a node for each item in the collection. E.g.
        forEach listItem in list:
         cache.put(fqn, listItemKey, listItem);
        This way only the added or removed item in the list is replicated, right?
      3. Use the POJO edition that proxies the collection and automatically takes care of adding and removing items to the collection.

        Thanks.