title: memcached as hibernate L2 layer cache
body: <p>I'm working on a project which uses hibernate 4 and Spring 3.2 and I'm looking for an open source L2 layer cache implementation. I know there are plenty of free products like Hazelcast (Free version) or Infinispan but it seems that they might have some performance issue under heavy loads because they are using memory inside the JVM and based on my research many people are complaining that garbage collection can make the server hang under even medium loads.</p>
  
  <p>There is an open source project "<a href="https://github.com/raykrueger/hibernate-memcached" rel="nofollow">hibernate-memcached</a>" which looks to be a good bet but this does not support hibernate 4 and the project looks like it may be dead (no updates during last 11 months). I'm surprised that there are no other open source applications that provide a hibernate 4 L2 cache provider for the memcache protocol. I did find <a href="https://github.com/debop/hibernate-redis" rel="nofollow">hibernate-redis</a> which supports Redis but I may prefer to use Couchbase because it seems to handle replication and sharding automatically.</p>
  
  <p>Any help will be appreciated.</p>