开发者

Hibernate vs Ibatis caching

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,


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.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜