Hi Brad,
I've come across the same thing in my work. Often the most expensive part
of building a dynamic page isn't so much the query, but the actual
'stringing' together of html -- but I guess it depends on your queries.
At www..devicetop.com, I cache almost all dynamic content (like page
templates, news feeds, listings that are updated periodically) in a either a
database (for html blobs that take over 10k, or in an internal hashtable for
extremely common templates.)
To do so, I implement a CacheManager object which checks to see if a dynamic
process requires updating, if it does it executes the logic to assemble the
chunk, if not, it gets the pre-assembled blob from a cache db. Process
which update dynamic listings (like news feed parsers) notify the
CacheManager when a blob should be replaced.
I highly recommend this methodology as it has resulted in significant
reduction in response times. Check out devicetop.com to see it in action.
cheers,
Mark.
-----Original Message-----
From: Brad Johnson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 20, 2000 4:07 PM
To: [EMAIL PROTECTED]
Subject: Re: A DB Cache...Servlet?
I'm currently building a web-based intranet that will serve 30-100 people
all day long (the ability to scale should be preserved, though). Each page
of the site will display large amounts of information extracted from an
Oracle Database and formatted/distributed by servlets and JSPs. Anywhere
from 15-20 different SQL queries should be able to gather the majority of
the information that needs to be displayed on the front end.
To avoid hammering the DB every time the results of a common query is needed
(and to keep the number of db connections low), it would be nice to cache
the common query results in an object or as class data for a number of
objects. The object(s) would have to persist until the server was shutdown.
Rare queries that do not match one of the standard 15-20 would warrant a
connection to the db. Also, the cache object would need to be notified if
any changes were made to the DB so that it could repopulate itself.
Would a servlet be well equipped to act as an cache for db information, or
is there another more standard means of doing this? Am I completely off
track? Any advice would be greatly appreciated.
Thanks
brad
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html