Discussions

Performance and scalability: How to build a distributed cache

  1. How to build a distributed cache (13 messages)

    Hi, I need to build a distributed cache that's shared by different JVMs. What's the best practice of implementing this? Thanks.

    Threaded Messages (13)

  2. Message Queue[ Go to top ]

    Have you thought about using a message queue?
  3. How to build a distributed cache[ Go to top ]

    Hi Jen,

    This is by no means an easy task, I would recommend taking a look at Coherence.

    Later,
    Rob Misek
    Tangosol, Inc.
    Coherence: It just works.
  4. Hi Jen,This is by no means an easy task, I would recommend taking a look at Coherence
    Yeah, this is true. The task of building a custom distributed cache is quite difficult. In a cluster with several JVM sharing the workload, you must build a cache system in which no one of this JVM has the total control of the information stored in the cache, because every node can go down or be shutdown, so a distributed cache systems looks more like a P2P system, where all the clones has a piece of information that shares with other nodes, but by no means, it has the total control of the integrity of the information, because all the JVM can be shutdown in every moment.

    In the 2001 I worked in a project where we needed to build a custom cache. The cache system had only a few lines of code (maybe less than 200) but if was very difficult to maintain, because the design was not obvious. You must be able to syncronize the changes of the information, but you don't want to saturate the network sending all the time information about changes of every piece of information.

    Maybe it could be easier if you adquire a product such as Coherence.


    Jose R. Huerga

    http://www.terra.es/personal/jrhuerga
  5. In the 2001 I worked in a project where we needed to build a custom cache. The cache system had only a few lines of code (maybe less than 200) but if was very difficult to maintain, because the design was not obvious. You must be able to syncronize the changes of the information, but you don't want to saturate the network sending all the time information about changes of every piece of information.

    Maybe it could be easier if you adquire a product such as Coherence.
    Thanks for the plug ;-)

    You can download a free evaluation copy from http://www.tangosol.com/download.jsp.

    If you have any questions while you are trying it out, just email to support at tangosol dot com.

    Peace,

    Cameron Purdy
    Tangosol, Inc.
    Coherence: Shared Memories for J2EE Clusters
  6. If your application is a wed based and if the information is really small you can store in the common JNDI tree. If it's large you may face some performance issue.

    Thanks,
    Sreedhar
  7. JBoss cache[ Go to top ]

    You can also have a look at Jboss cache http://www.jboss.org/products/jbosscache
  8. How to build a distributed cache[ Go to top ]

    The effort for building scalable, consistent , clustered, flexible, none intrusive, ultra fast distributed cache to handle huge amount of concurrent users is for sure very complicated and needs special technology and powerful algorithms to handle the memory efficiently. We are relaying on 30 years of research with our product and massive development done for the last 5 years by top professional engineers.
    See GigaSpaces Grid Server with its distributed cache that provides MAP API , JavaSpaces API , JDBC API , JMS API and got plugins for Hibernate and JDO.

    http://www.gigaspaces.com/docs/doc/gigaspaces_distributed_caching.htm
    http://www.gigaspaces.com/docs/doc/hibernate_cache.htm
    http://www.gigaspaces.com/docs/doc/gigaspaces_cluster.htm

    Best Regards,
            Shay
    ----------------------------------------------------
    Shay Hassidim
    Product Manager, GigaSpaces Technologies
    Email: shay at gigaspaces dot com
    Website: http://www.gigaspaces.com
  9. RE: How to build a distributed cache[ Go to top ]

    I agree with others that developing your own distributed cache is a major undertaking. Additionally, why do it if you can find a good commerical distributed cache. NCache provides native APIs for .NET and Java (without any interoperability). It also provides distributed ASP.NET Session State storage. NCache provides integration for NHibernate as well. Check it out at: http://www.alachisoft.com http://www.alachisoft.com/rp.php?dest=/ncache/nhibernate_index.html
  10. Re: How to build a distributed cache[ Go to top ]

    Some additional links: Cluster your objects and your data using Tangosol Coherence Provide a Tangosol Coherence Queryable Data Fabric Provide a Tangosol Coherence Data Grid Real Time Desktop Peace, Cameron Purdy Tangosol Coherence: Java Data Grid and Clustered Cache
  11. You may want to check out EhCache. It's the most widely-deployed open source cache compliant to JSR-107 JCACHE spec. It can be run as a distributed cache in a number of ways, depending on how much scale and availability you need. There's a peer-to-peer replicated mode at one end of the scale continuum. At the other end, there's a high scale, coherent, and persistent mode backed by Terracotta. http://www.terracotta.org/web/display/orgsite/Terracotta+Distributed+Cache+Overview
  12. distributed caching[ Go to top ]

    NCache is a distributed caching solution for .NET and JAVA. It is easily configured and gives you scalable performance even at peak load times. Creating cache is easy and you have options to create replicated, partitioned  or partitioned-replica cache. 

    Data intensive applications facing slowdown need distributed caching like Ncache to boost up performance. Ncache is downloable from http://www.alachisoft.com/download.html and you try the product for free for 2 months.

  13. Check out Hazelcast, an open source, transactional, distributed caching solution for Java. It is super simple to use; add the hazelcast jar into your classpath and start coding. Hibernate second level cache plugin is also available. 

    Hazelcast is a little more than a cache: it is distributed map, queue, topic, lock and executor service for Java.

    -talip

    http://www.hazelcast.com

  14. ASP.NET Session Storage Issues[ Go to top ]

    ASP.NET cache has several problems as highlighted above and here:


    http://distributedcache.blogspot.com/2010/05/aspnet-session-storage-issues.html


    http://distributedcache.blogspot.com/2010/05/aspnet-performance-and-scalability.html


    So, it is not recommended for data-intensive and mission-critical applications.