2

Anyone had production experience with distributed caching for Mybatis? I saw some suggestions for ehcache/Terracotta, but previous experience with Terracotta would make me want to stay away from it (complex to configure and keep running). Hazelcast seems like an interesting possibility - anyone tried using it as a distributed cache with Mybatis?

Our app has a relatively large database (1TB), so we'd like a solution which scales well.

3 Answers 3

4

At MyBatis, we already released a MyBatis/Hazelcast bridge module.

2
  • Thanks, Simone! We'll try it out and provide feedback May 7, 2012 at 14:52
  • Simone - what are the criteria for choosing between OSCache, memcached and Hazelcast? We obviously want performance, reliability, efficiency - can you give any recommendations between the caches which mybatis supports? For instance, I can imagine that the single-point of failure issues are different since Hazelcast distributes redundant copies of the cache across all nodes (but presumably requires additional resources for this)... May 8, 2012 at 9:46
1

I have been using Ehcache with Mybatis+Spring for production and its very effective. And its configuration is pretty simple. (hardly 10 lines xml file)

On personal level my Suggestion would be using Ehcache.

PS : I do use hazelcast for diff purpose which requires distributed caching and its great too but for MyBatis it's like shooting an Insect with Gun.!

0

I am using Redis for cluster caching. Totally I have 5 nodes running on it and cache is never the bottleneck.

The official plugin https://github.com/mybatis/redis-cache works well but lack of efficiency, I improved it a little bit with cluster support and more efficient timeout control https://github.com/MiltonLai/redis-cache

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.