Object and query caching

Many optimizations rely on in-memory caching of database query result sets. EAServer has two cache mechanisms for caching container managed field data and query results:

EAServer creates and manages these caches internally. There are no configuration entity types to configure them explicitly; rather, they are configured implicitly by your CMP table and field mapping configuration settings.

Caching can improve performance by minimizing the number of database select queries required for ejbLoad operations, finder method invocations, and ejbSelect method invocations. Most database applications are governed by the 80:20 rule: 80% of users access 20% of the data. Object caching increases performance and scalability by allowing faster access to the most recently used data.

Assuming that the database access is the principal bottleneck, the expected performance gain falls in these ranges, depending on the ratio of update to read-only transactions:

Besides the transaction mix, the actual performance gain depends on:

In summary, the best use case for caching is data that is static. If the data changes often, the overhead of updating caches can outweigh the performance benefits of caching. If the data is updated too frequently, soft locking or hard locking may yield better performance. Furthermore, the data consistency requirements dictate how cached data can be used. Decide how much consistency you require, then optimize within those constraints.