> Would you say using databased client variables is safer then using session
> variables even if your database is Access ( low volume sites).
I would say so, yes. I do not do any work with Access, but this is not
really as much a database question as it is a server resource question.
Session variables are stored in memory. The same memory that everything
else on your server is stored in. That is too say, that if you have some
service or utility that ever spikes the ram on your web server box, you lose
all your session variables. If you manage state in memory, you are hoping
that every time you access that memory it hasn't been corrupted either by a
spike in ram or a server being reboot or whatever. The whatever here is of
special concern. Don't forget, ColdFusion is often running on the same box
as your web server. So all those dandy things that Allaire hasn't quite got
their arms around (e.g.., CFMAIL, CFFTP et al) can bleed the hell out of
your system resources as well.
Low volume web sites are especially vulnerable to this as they are generally
hosted on boxes that are not outfitted with gigs of ram and processor speed.
They are in fact set up to be low volume boxes. The adage "Minimum effort,
for minimum wage" comes to mind. What's worse is when said apps are hosted
on shared servers. If your low volume website is hosted on a shared server,
be very afraid of session variables, as you are now putting your state
management into the hands of everyone else that has built an app on that
box. That is, their memory resources are your memory resources. And their
Allaire certified (:::cough:::) coding practices are pinching from the same
bag of memory that you are. I really hate to sound like a smoker fresh out
of Smokers Anonymous here, but I used to be a session variable junkie and
when I stopped using them, the funky ass results were fewer and the scaling
became faster.
> Secondly how does it impact performance having to constantly update and
query a
> database.
Yes, session variables are faster because you do not have to hit the
database to get at them, however the speed difference is milliseconds which
(in my not so humble opinion) is not enough for me to hand over state
management to system memory that may or may not be available when I access
it.
Now someone might argue "Well I have a gig of ram, this small app is the
only thing that will ever run on this box and only 5 people are ever going
to use it". So I would say great, stay with session variables if you are
never going to leave that enviroment. Unfortunately, in the present
application development enviroment I have found that business logic and
scope change without much warning. What was one person's recipe book today
is marthastewart.com tomorrow. And it better be ready to handle the traffic
tomorrow.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists