As Couchbase continues to experience growth as a company and increased adoption by the open source community we continue to encounter new challenges and use cases along the way. Many enterprises are turning to us to help add a cache to an existing application or evolve applications to next generation technologies. For these level two cache implementations we’ve helped develop a data access layer for applications in the Spring project. Spring Data Couchbase provides integration with the Couchbase Server cluster by providing POJO centric data interaction with Couchbase Buckets and helping to provide a repository-style implementation. This effort has been very successful and has generated a lot of interest.
However, there’s more to the story a simple web search for “JPA” uncovers that helps us understand additional needs across the enterprise. While the JPA standard is well defined ultimately each vendor implementation varies enough that supporting specific ORM’s like Eclipselink and Hibernate would require additional work. We engaged our partners at Thumbtack Technology who deployed one of their expert NOSQL development teams to help get the job done.
The objective was to provide a framework of boilerplate code to leverage Couchbase as a level two cache for both Eclipselink and Hibernate. There are improvements coming with the release of our 2.0 SDK’s and additional integration improvements but we wanted to be able to support these caching efforts in the near term. Bothe the Hibernate and Eclipselink JPA connectors have been published by Thumbtack on github with test cases to show the configuration.
While there is always the ability to leverage Moxi to enable existing memcached clients to be vbubket aware. We knew the javax.persistance package had a cache interface available but each vendor implementation requires nuances that need to be addressed. For example, in reviewing the the associated eclipselink documentation shows the ability to add a level 2 cache but nothing that helps us understand the specifics of leveraging a NoSQL solution. Thumbtack helped us solve these configuration challenges.
<-- Example for test cases —>
<-- each entity needs a Class Customizer -->
Additional details in getting the Thumbtack test cases running locally can be found in the github repositories.
These connectors provide us the ability to extend existing applications by adding an object cache with a durable cluster. By leveraging the power of Couchbase we can prevent Cold Cache, dramatically reduce load on your RDBMS, auto-shard across the cluster and provide a durable object store.