Discussions

General J2EE: Transactional Database Cache

  1. Transactional Database Cache (2 messages)

    Hi all,

    I am looking for a transactional, non replicated, (possibly open source) database cache.

    My App <--> Cache <--> Database Driver

    The intent is that my application will be TOTALLY ignorant of the transactional cache. I will just bind it with the right name in the JNDI explorer, and connect the cache to the database. What open source cache implementations are there out there ?

    Again, i am NOT looking for an Object cache like JBossCache or JCache. Any help is appreciated :-)

    Dushy
  2. Herez some update:

    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 !!!
  3. You can try CSQL Cache which is open source transactional database cache. Check http://csqlcache.wordpress.com for more information about database caching. Product page for csql is at http://sourceforge.net/projects/csql