#2 Running Swarmcache with multiple Tomcat instances

open
nobody
None
5
2003-08-12
2003-08-12
Anonymous
No

Using swarmcache 0.91.

Does Swarmcache support multiple instances of a cache
on the same machine?

For example, I'm running 2 instances of Tomcat 4.1.18
on the same machine. The caches seem to be
communicating (according to the log files) between
instances. When I retrieve an object in Tomcat
Instance 1 (goes to DB...stores in cache), and then
attempt to retrieve it in Tomcat Instance 2, I would
expect Instance 2 to get it from the cache. Instead it
goes to the DB.

Is the above scenario supported by
Swarmcache/Javagroups? Again, I'm running 2 instances
of Tomcat on the same machine.

Thanks,
swood19@yahoo.com

Discussion

  • André Schild
    André Schild
    2003-09-09

    Logged In: YES
    user_id=119137

    Hello,

    no, swarmcache is not a cache who shares it's content
    between instances. (No matter if on same maschine or not)

    Each Swarmcache instance is basically running independent
    of all other caches.
    When a entry is put in the cache, then it is only in the
    cache of this instance.
    But, when you invalidate the cache (or only a entry) then this
    cache invalidation is replicated via JavaGroups to all connected
    instances.
    That way, the cache remains consistent even across multiple
    instances.

    The benefit of this are:
    - The communication overhead is very small
    - No problems when a cache instance goes down

    So we can say, that swarmcache isn't a distributed cache,
    but a cache who grants consistent cache entries in a
    distributed environment.

    Andr