Open Source Distributed Cache Solutions Written in Java

Share the article!

Found Jason Carreira’s blog entry about distributed caching. Anyway, a lot of interesting cache solutions were mentioned by readers. So, in the continuing tradition I bring you the review of open source distributed cache solutions written in Java.

  • Java Caching System (i.e. JCS) – The JCS goes beyond simply caching objects in memory. It provides several important features, necessary for any Enterprise level caching system, features include Memory management,
    disk overflow,
    element grouping,
    quick nested categorical removal,
    data expiration,
    extensible framework,
    fully configurable runtime parameters,
    remote synchronization,
    remote store recovery,
    non-blocking “zombie” pattern,
    optional lateral distribution of elements,
    remote server clustering and failover. These features provide a framework with no point of failure, allowing for full session failover including session data across up to 256 servers.
  • Swarmcache – SwarmCache is a simple but effective distributed cache. It uses IP multicast to efficiently communicate with any number of hosts on a LAN. It is specifically designed for use by clustered, database-driven web applications. Such applications typically have many more read operations than write operations, which allows SwarmCache to deliver the greatest performance gains. SwarmCache uses JavaGroups internally to manage the membership and communications of its distributed cache.
  • JGroups ReplicatedHashtable and DistributedHashtable – A DistributedHashtable is derived from java.util.Hashtable and allows to create several instances of hashtables in different processes. All of these instances have exactly the same state at all times. Modifications such as put(), clear() or remove() will be propagated in orderly fashion to all replicas. Read-only requests such as get() will only be sent to the local copy. ReplicatedHashtable provides exactly the same methods as as DistributedHashtable. However, it is implemented differently. Whereas the latter uses synchronous remote group method invocation (similar to RpcDispatcher), the former uses asynchronous communication to keep the replicas up-to-date.
  • OSCache – OSCache is a widely used, high performance J2EE caching solution. Features include fast in-memory caching, persistent on-disk caching, written with performance in mind, clustering support, flexible caching System, comprehensive API, exception handling, cache flushing, portable caching and i18n aware.
  • FreePastry – FreePastry is a modular, open source implementation of the Pastry p2p routing and location substrate. Pastry is a generic, scalable and efficient substrate for peer-to-peer applications. Pastry nodes form a decentralized, self-organizing and fault-tolerant overlay network within the Internet. Pastry provides efficient request routing, deterministic object location, and load balancing in an application-independent manner. Furthermore, Pastry provides mechanisms that support and facilitate application-specific object replication, caching, and fault recovery. The proponents of Pastry work for Microsoft, however they’ve made an excellent choice sticking with Java.
  • OceanStore – OceanStore is a global persistent data store designed to scale to billions of users. It provides a consistent, highly-available, and durable storage utility atop an infrastructure comprised of untrusted servers. OceanStore caches data promiscuously; any server may create a local replica of any data object. These local replicas provide faster access and robustness to network partitions. They also reduce network congestion by localizing access traffic. Pond, the OceanStore prototype, is currently available for download.
  • EHCache – A replacement for JCS. EHCache started out as some patches for JCS to correct threading and memory leak problems. EHCache is faster than JCS. Acts as a pluggable cache for Hibernate 2.1. Small foot print, both in terms of size and memory requirements. Implements JCACHE. Implemented by some guys at ThoughtWorks.

  • JXTA 2 Shared Resource Distributed Index (SRDI) – A loosely consistent, fault-resilient, distributed hash table. The JXTA 2 network acts as an always-available, network-wide, dynamic, distributed data structure: a virtual hash table containing the index of all the published advertisements in the entire JXTA group. An edge peer can query the hash table at any time by supplying a set of attributes — the hash keys in the table. If you figure out how to use SRDI for your own generic cacheing needs, please let us know!
  • JBossCache – JBossCache consists of two modules: TreeCache (a replicated transactional tree-structured cache) and TreeCacheAop (a subclass of TreeCache using AOP to dynamically replicate Plain Old Java Objects [POJOs]).
  • Open Source Java Caching Service – Java Caching Service is an effort to make an Open Source version of JSR-107 JCache. Since the JSR-107 hasnt released any specs for years, This version still builds on the original Functional Specification. Features include ability to set an maximum size for the memory requirements; spools old objects to disk with max-size requirements; group elements with support for nested groups to create cache-trees; easily remove whole branches of the cache; automatic time-based expiration; fully user configurable; support for cache-loaders and upport for distribution.
  • Bamboo DHT – A distributed hash table, or DHT, is a building block for peer-to-peer applications. At the most basic level, it allows a group of distributed hosts to collectively manage a mapping from keys to data values, without any fixed hierarchy, and with very little human assistance. This building block can then be used to ease the implementation of a diverse variety of peer-to-peer applications such as file sharing services, DNS replacements, web caches, etc.
  • jofti – Jofti is a simple to use, high-performance object indexing and searching solution for Objects in a Caching layer or storage structure that supports the Map interface. The framework provides for transparent addition, removal and updating of objects in its index as well as simple to use query capabilties for searching. Jofti has been designed to allow developers to use their favourite caching solution (JBoss, OSCache, EHCache or any Map interface) as a plug-in.
  • ShiftOne Java Object Cache – ShiftOne Java Object Cache is a Java library that implements several strict object caching policies, decorators that add behavior, and a light framework for configuring them for an application.
  • Terracotta – Distributed caches shared through Terracotta improve throughput without changing code. Terracotta can use other distributed cache solutions without actually impact your source code relative to the single-server implementation. Terracotta supports all datas tructures and not just Maps. It supports caching frameworks including EHCache, JBoss TreeCache, JCS and OSCache. It does not require that objects implement Serializable.
  • JBoss Cache – tJBoss Cache is a replicated and transactional cache. JBoss is transactional using JTA compliant transaction manager. JBoss Cache consists of two components: a generic cache (TreeCache) and a POJO cache (PojoCache). TreeCache is a tree-structured cache that provides replication and transaction context, while PojoCache extends the functionality of TreeCache but behaves as a true object cache providing transparent and finer-grained object mapping into internal cache.
  • j-memcached – A port of memcached server to java. It conforms to the memcached protocol specification. Currently, the Java version is half the speed of the C version.
  • Shoal – Shoal is a scalable dynamic clustering framework that provides infrastructure to build fault tolerance, reliability and availability. Shoal provides a Group Management Service (GMS) that
    provides group membership management through discovery of events, join, shutdown and failure notifications, delegated recovery initiation, and state caching facilities
  • WADI – WADI is an acronym of ‘WADI Application Distribution Infrastructure’. WADI is a clustering framework that manages and ensures the scalable and transparent high availability of state and services. The WADI project aims to resolve many of the problems of dealing with state in a cluster. WADI currently supports Jetty and Geronimo.

Like before, if you do know of any other project that’s worth mentioning, please feel free to leave a comment.

Share the article!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>