Cache on an app server cluster


General J2EE: Cache on an app server cluster

  1. Cache on an app server cluster (2 messages)

    Here is the scenario:

    A cache of about 70 MB has to be implemented. It is only updated once in a day and read very frequently. What would be the best strategy to implement it for many weblogic servers in a cluster. Yes, the state of the cache should be identical across the cluster.

    I know of two options.
    1. Each server loads up the cache from the database and the cache is saved in memory as a normal hashmap object.
    2. Use session bean to implement cache.

    I would appreciate if someone could point the pros and cons of the second approach.


    Threaded Messages (2)

  2. Cache on an app server cluster[ Go to top ]

    There is not much point in implementing your cache as a session bean. The main reasons to use a session are:

    a) Need to access information remotely.
    b) Need to make operations transactional.

    Neither of these are relevant for local caches. I would go with option (1) (a simple in memory cache with a HashMap).
  3. Cache on an app server cluster[ Go to top ]

    Hi Arihant,

    There is a third option, Tangosol's Coherence. Coherence's Replicated cache seems to be exactly what you are looking for. Using the cluster-wide locking mechanism you can maintain concurrency (i.e. state) across the cluster.

    Rob Misek
    Tangosol Coherence: Cluster your Work. Work your Cluster.
    Coherence Forums.