My favorites are:
Ehcache and OScache
Ehcache is used by hibernate by default.
but, I do most of my dev with java. There are caching solutions for most languages if you use something else.
For example, with hibernate. You ask hibernate for an object, it first checks the cache to see if it has it. If not, it queries the database and stores the object in the cache before returning to you. You can make lots of changes to the object (you just have a ref to the object in the cache). Other requests can ask for the object and get it out of the cache. Hibernate has a background process that syncs the objects in the cache with the database.
So, you could potentially have a 100 changes to the object and only one SQL UPDATE get executed (with the latest version). It's one of the reasons why working with a library like hibernate can have such high performance.
Of course, there options to explicitly flush the cache (sync cache with the database) when working in a transaction dependent environment.
|