Home arrow Oracle arrow Generic Architecture for Caching Table Data: Supercharge Your Cache

Generic Architecture for Caching Table Data: Supercharge Your Cache

In the first part of this series we started of by putting the basic structures in place for a cache and wrote some code to manage the cache. In this next part, we will extend the functionality of our cache.

  1. Generic Architecture for Caching Table Data: Supercharge Your Cache
  2. Switching the cache on and off
  3. Don’t Forget to Flush
  4. Conclusion
By: Mark Vilrokx
Rating: starstarstarstarstar / 4
October 18, 2005

print this article



Things to look out for when using a cache

Although caching is a fabulous way to increase performance, it has a couple of drawbacks.  First of all, data in the cache can get out of sync with the data in the database: a record you cached might get updated or even removed from the database.  This is one of the reasons you should not use caching on transactional data that gets changed a lot.  These synchronization issues can result in “unpredictable” behavior of your code and are potentially very hard to debug.  Because we hide our caching logic, a fellow developer who is using your package might not understand why, when the database says “The Department Name of department 20 is R&D”, your procedure consistently returns that “The Department Name of department 20 is Research”.

A second issue with caching is that, by its very nature, it consumes memory.  This becomes a problem when either your cache becomes very big or there are many users who simultaneously, in separate sessions, use your package, spawning many caches.  Besides causing memory issues, big caches also tend to become slower, that is they do not scale very well.  This obviously defeats the purpose of having a cache in the first place so try to keep them as small as possible.

In a later part of this series we will try to implement solutions for these issues but for now, like a true developer, I first would like to try an easy solution.

>>> More Oracle Articles          >>> More By Mark Vilrokx

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Oracle Java Security Woes Continue
- Oracle's New IaaS Cloud Option: There's a Ca...
- Oracle Acquires Eloqua to Boost Cloud Presen...
- Choosing Innovation: Oracle Survey Insights
- Oracle Fixes Privilege Escalation Bug
- Oracle`s Communications Service Availability...
- Oracle Releases Exalytics, Taleo Plans
- Oracle Releases Communications Network Integ...
- Oracle Releases Communications Data Model 11...
- Oracle Releases PeopleSoft PeopleTools 8.52
- Oracle Integrates Cloudera Apache Distro, My...
- Oracle Releases MySQL 5.5.18
- Oracle Announces NoSQL Database Availability
- Sorting Database Columns With the SELECT Sta...
- Retrieving Table Data with the LIKE Operator

Developer Shed Affiliates


Dev Shed Tutorial Topics: