10 Replies Latest reply: Apr 6, 2010 4:11 PM by craig bomba RSS

Infinispan 2nd Level Cache Server

craig bomba Novice
New to Infinispan.....can I set up Infinispan as a L2 cache server (Distributed mode) similar to the way this is done with Oracle's Coherence?
  • 1. Re: Infinispan 2nd Level Cache Server
    Sanne Grinovero Master

    hello, welcome,

    Infinispan is flexible and used for example - among others - as a clustered L2 cache for Hibernate.

    I don't know what you expect from Coherence, what are your exact requirements? you mean invalidation perhaps?

  • 2. Re: Infinispan 2nd Level Cache Server
    craig bomba Novice

    Coherence comes with a cache server out-of-the-box that can act as an L2 cache (outside of your application's VM).  I don't have too many requirements on invalidation/eviction at this time.  I realize I can probably construct such a thing with a product like Infinispan, but wondering if it may come with one? 

     

    In the simplest form I am looking to see if I can share a map between 2 JVMs.  The maps would be kept in sync and eviction would only come from explicit removals.  There is only one owner (i.e. one of the VMs will do the puts).  Through the sharing of my map I can provide high availability of my application.  I do not want to compromise that.

     

    On the subject of configuring for replicated versus distributed...

    If I configure for replicated, can I still choose sync versus async for puts into the map?  Same question for distributed.  And, what does a put latency for a sync put into a replicated cache look like in comparison to a put latency for a sync put into a distributed cache?

     

    Thank you.

  • 3. Re: Infinispan 2nd Level Cache Server
    Galder Zamarreño Master

    For setting up 2 VMs, see http://community.jboss.org/docs/DOC-13690. In http://community.jboss.org/docs/DOC-13441, you can get more familiar with the API.

     

    Async/sync are of course available options, see http://community.jboss.org/docs/DOC-14853

     

    Wrt sync put in repl vs sync put in distributed, distributed case will be faster specially as the number of nodes increase because in replication, the put is replicated to all nodes in the cluster. In a 2-node cluster, differences between replication and distribution are not that big for puts.

  • 4. Re: Infinispan 2nd Level Cache Server
    Rafael Ribeiro Novice

    I guess craig was looking for something like eXtreme Scale startOgServer.sh which is responsible for starting VMs which sole responsibility is being replicas/containers for the DataGrid, completely detached from client application.

    Craig, download full version and have a look at startServer.sh(and .bat) on bin directory.

     

    regards,

    Rafael Ribeiro

  • 5. Re: Infinispan 2nd Level Cache Server
    craig bomba Novice

    Rafael,

     

    Thank you.  Is this new to 4.1 Alpha?  I did not see the similar scripts in the 4.0 Final that I had downloaded.  Not sure if you are familiar with Coherence....if so, do you know how it is similar/different from their cacheServer concept?

  • 6. Re: Infinispan 2nd Level Cache Server
    Rafael Ribeiro Novice

    I checked here the 4.0.0-all zip I had and indeed it seems to be available only after 4.0.0 release.

    I don't know Coherence but I've been using WebSphere eXtreme Scale and it seems a lot like its concept of ogServer (or container as they call it now).

    But I guess it wont be any different from a simple main class that starts up, searches for configuration files and starts up a grid node. I guess you can safely get this new main class and use it on previous version.

  • 7. Re: Infinispan 2nd Level Cache Server
    craig bomba Novice

    Thanks Rafael.  I'll take a look and see.  Once I have a chance to do so I'll post something here for others.

  • 8. Re: Infinispan 2nd Level Cache Server
    Galder Zamarreño Master

    craig/Rafael, that startServer.sh/bat that you're talking about is for starting Infinispan server instances that can be talked to remotely using either our own Hot Rod protocol or the Memcached protocol. See http://community.jboss.org/docs/DOC-15093 and http://community.jboss.org/docs/DOC-14644

     

    Is this what you're looking for?

  • 9. Re: Infinispan 2nd Level Cache Server
    Rafael Ribeiro Novice

    Hi Galder,

    Galder Zamarreno wrote:

     

    craig/Rafael, that startServer.sh/bat that you're talking about is for starting Infinispan server instances that can be talked to remotely using either our own Hot Rod protocol or the Memcached protocol. See http://community.jboss.org/docs/DOC-15093 and http://community.jboss.org/docs/DOC-14644

     

    Is this what you're looking for?

    That's exaclty what I mentioned and I guess that's what Craig was looking for.

    If we opt for this approach we are somehow implementing the old near/far cache pattern from JBoss TreeCache, right?

     

    regards,

    Rafael Ribeiro

  • 10. Re: Infinispan 2nd Level Cache Server
    craig bomba Novice

    For now, the answer is that this sounds like it may be what I want.  I do plan to look at it some time in the next 2 weeks as my schedule allows. 

     

    I am completely Java, so language neutral stuff is not of particular importance.  However, as it sounds like it may satisfy the desire to remotely connect to a cache.  Ultimately I would like to add high availability to a cache in my JVM.  In a 2 machine scenario, the approach to this with Coherence was to have 4 JVMs.  One that represents my main app.  One that represents a warm standby of my app on another machine.  The other 2 JVMs are cache server VMs (backing one another up - one on each of the 2 machines).  If my app fails I can switch to the standby guy.  If one of the cache server fails I still have another.  If I lose an entire box, I am still OK as well.