12 Eylül 2018 Çarşamba

Second Level Cache

Giriş
Second Level Cache ile veri ehcache, Hazelcast gibi bir cache sağlayıcısı üzerinde saklanır

Java Serialization Kullanır
Açıklaması şöyle.
No Custom serialization - Memory intensive
If you use second level caching you would not be able to use fast serialization frameworks as Kryo and will have to stick to java serializeable which sucks.

On top of this for each entity type you will have a separate region and within each region you will have entry for each key of each entity. In terms of memory efficiency this is inefficient.
Entity'ler Id Alanı İle Saklanır
Açıklaması şöyle.
Using 2nd level cache is easier to setup but it only stores entities by id. There is also a query cache, storing ids returned by a given query. So the 2nd level cache is a two step process that you need to fine tune to get the best performance. When you execute projection queries the 2nd level object cache won't help you, since it only operates on entity load. The main advantage of 2nd level cache is that it's easier to keep it in sync whenever data changes, especially if all your data is persisted by hibernate.



Hiç yorum yok:

Yorum Gönder