posted 19 years ago
Avi,
Thanks for the reply. I don't think OSCache (the cache product of opensymphony.com) is quite what I'm looking for.
What I am looking for is kind of like an in memory database which does transactions, some basic caching and ultimately stores the updates to the database. I'm already running on DB2 and am looking for a cache to front my database. I am running on a mainframe with few users so I seriously doubt i will be doing clustering.
Here is an example of what I have in mind.
1. User 1 executes a "SELECT NAME FROM USERTABLE WHERE ID = 1234"
2. The database driver the application is using is actually a proxy to the actual driver. This driver has a cache defined. Since this is the first time the application has executed this statement, the cache queries the database. The cache system caches result and since I guarantee that the database will NOT be updated outside the scope of the cache, it should be fine.
3. User 2 executes a "SELECT NAME FROM USERTABLE WHERE ID = 1234"
4. Since no one updated the USERTABLE, the cache does NOT hit the database, but returns a result from the cache.
5. User 2 performs an update on the user table with the id 1234, and commits
6. Since the table has been updated, the cache system either (depending on how smart it is) evicts the result of the select operation, or updates it's state in memory and avoids another select hit to the database
7. User 1 invokes "SELECT NAME FROM USERTABLE WHERE ID = 1234", the cache returns the correct result.
8. And yes, the cache should have basic caching features like max size, a couple of choices of algorithms like LRU or FIFO to manage the lifecycle of the cached data.
I think there are open source products like this, I'm not searching hard enough !!!
SJCP, SCBCD, SJCD, SCDJWS, SCEA (Part I)