On Sunday, Jul 13, 2003, at 13:21 US/Pacific, Matt Robertson wrote:
> Well, I don't fully understand where you're at applicationwise, but I
> try to use a cached query for most of my application-wide settings.

Interesting. mm.com uses a couple of techniques:
1. 'constant' values are set in request scope for every request via an 
include file pulled into Application.cfm (e.g., server names - the 
include file is auto-generated by the build system).
2. 'initialized-once' entities are lazily created and stored in shared 
scope (we use server scope since we don't share with other apps, most 
folks would use application scope).

The second class of entities includes certain database-derived values, 
e.g., localized application strings. These are created by running a 
'bootstrap' script - none of the applications of the server will run 
unless the system is bootstrapped and we can re-run the bootstrap if 
needed to refresh the server scope entities.

The bootstrap script can only be executed within the firewall - the 
equivalent of having an application admin option to refresh the values 
stored in application scope.

We don't rely on simple cached queries because:
1. the 'constant' entities come from a file that is auto-generated by a 
build script: it would be more effort to have the build system populate 
the database and then have the applications pull those back from the 
database - it would also require that each server environment used a 
different database whereas we often share databases between distinct 
testing / development systems.
2. the more complex entities are calculated from a variety of sources - 
sometimes including calling web services - so the calculated entity 
needs to cached, rather than the raw data underneath.

For many, simpler applications, Matt's solution is a very good one - 
appropriate caching means the database is hit as rarely as you want it 
to be.

Sean A Corfield -- http://www.corfield.org/blog/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to