• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to implement a Writable In Memory Cache

 
Tarun Chatterjee
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would want to cache data from a few Database Tables and Properties files . The data in the tables can be updatable and i would want the cache to be updated automatically without any user intervention once the Database operations are performed.

Can anyone suggets a good way of doing it?.
Is there are readymade framework /open source code that i can use?

Regards
Tarun Chatterjee

Email: chatterjee_tin@yahoo.com
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35713
410
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tarun,
It depends on who is doing the updates. If it is your application and everything is running in one JVM, you can use the Observer pattern.

If other applications, other JVMs or direct database writes can be done, you have to use time to expire the cache.
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hm. You could, depending on the databases capabilities, use a stored procedure and triggers, and send a message for every update to an adress, where the application is listening.

'Performance' is the first doubt I get, thinking about it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!