Let say i have a table which has Master Data
seeded 1 time, and rarely it gets updated. It has a flat structure entity, nothing sort of Lazy attributes
.
Address{
id,
country,
state,
city,
pincode,
area
}
Case -1 : Table has 1000 records
Case-2 : Table has 1 million records
Use Case - Need to get full Address object
by id. No updation in transaction in this table, just used for display purpose, LOV's, reference Id etc.
Considering performance, memory usages, GC, search speed etc which one is better using Hibernate cache(id, object) for this or just using
static HashMap (is as key, Address object as value)
.I know
Hibernate 2nd level cache
(ehcache
,Infinispan
etc) also uses Map structure deep inside libraries. So does it add any useful in above cases, to add extra layer of Hibernate.