views:

469

answers:

1

Hi,

We can speed up a hibernate app easyly with 2nd level cache using infinispan or ehcache/terracotta,... but ibatis only have a simple interface to implement for caching. And hibernate knows more information about the data, so it helps for better caching, too. In the other side, the simplicity of ibatis is also the power of it and it's faster than hibernate if we don't use caching for both.

My question is; if I use hibernate with 2nd level cache and ibatis3 with a cache implementation for it's interface, which will be more faster candidate for data access layer ?

Cheers,

+1  A: 

Fast is not a general quality, the performance must be considered in context.

A good approach seem to be:

  1. code fast enough, efficient enough the many many queries you need in your whole application. Finish that phase earlier, because you code fast, you don't use a tricky technology for performance.
  2. find the 1% queries that are not fast enough, that are called often etc, so they make up the most total time (considering only the ones where a real user is waiting).
  3. spend enough time optimizing this (you have this time because you gained time in phase 1). You can use things so fast that you wouldn't have considered them globally (memory cache, native SQL, database procedures....).
  4. go back to 2 until you run out of time, or your users are satisfied.
KLE
thanks, really a valuable answer
sirmak
@sirmak You very welcome. I also liked your question :-)
KLE