manuelbernhardt / tm

Oxiras Test Management Suite
http://www.oxiras.com
1 stars 0 forks source link

Caching #2

Open manuelbernhardt opened 13 years ago

manuelbernhardt commented 13 years ago

In many places, caching would be a very good idea.

This, however, is an optimization concern so it should come last (but should not be forgotten). We should use the Play! cache API so we can switch to a cache provider that supports clustered environments easily.

For now I am marking all the places where caching needs to be done with a TODO.

gwenael-alizon commented 13 years ago

Caching sounds good. Whether there is an actual need for it or not can be assessed with various stress tests.

manuelbernhardt commented 13 years ago

More thoughts on caching:

It is much easier and better performance-wise to cache IDs rather than whole entities. JPA entities become stale when detached from the persistance context so one would have to merge them every time they're read from the cache, and this effectively leads to a query being issued, which renders the whole purpose of the cache useless. Hence instead of using methods like e.g. TMController.getConnectedUser() we should switch to methods of the kind TMController.getConnectedUserId() and perform operations based on IDs.