In some cases it certainly makes sense storing global variables in the dB,
though you could look at it from the other side as caching dB data in global
variables ;-)
for example with our multilingual site all the labels are loaded into an
application scope structure of arrays per language:
#Application.labels['FR'][135]#  will give label 135 in French...

The whole point of global variable in dB usage is the caching for speed (one
dB hit per timeout of application variables) with flexibility and management
of data in the dB. 
There is a price to pay - you need locking - CFLOCK.

HTH,
Noam

        ----------
        From:  John Quarto-vonTivadar [SMTP:[EMAIL PROTECTED]]
        Sent:  Wednesday, 23 August 2000 0:46
        To:  [EMAIL PROTECTED]
        Subject:  Re: store global variables in db?

        > The bigger focus was storing global variables in the database,
rather than
        > hard coding them in the template, in order for them to be changed
through
        a
        > web interface.  Any potential problems there?

        well i guess it depends on the scope of the app. I find it just much
easier
        to have a configuration file that sets all these variables, since
typically
        global variables stay somewhat constant once the app gets out of
beta.

        Further you are going to HAVE to use some pre-set non-DB global
variables,
        if only to point to the datasource in which the rest of the
variables are
        stored! :) in for a penny, in for a pound. :)  Plus, as small as it
might
        be, storing the global vars in a db does mean a hit to the db, so it
gives
        another point of failure if the db server is a separate machine.
Seriously,
        tho, if you had many, many such variables then I guess your approach
can
        make some sense--I just don't see what you are saving by doing it
that way.

         Now, of course, this is a different matter altogether if you are
proposing
        storing user specific variables

        
----------------------------------------------------------------------------
--
        To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/fusebox or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/fusebox or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to