tags:

views:

373

answers:

4

In a high load application, is it better to put the client storage in the Registry or in a database? I am concerned that my high load will cause more database connections for client storage information and slow everything down. FYI: We use ColdFusion on Linux

Thoughts?

+5  A: 

If you store client variables in the registry (IMHO), you will have more of a performance impact with a high load. When Coldfusion stores the client variables in the DataBase, they are read at the beginning of the page request, and then after the page is complied, they are re-stored in the database. If you have connection pooling turned on in the administrator, this can be a very effective way to store the variables.

See: http://www.coldfusionmuse.com/index.cfm/2009/7/8/client.variables.reserved.word

andrewWinn
When you mention "connection pooling", do you mean "maintain connections across client requests" when setting up the datasource in the Coldfusion administrator?
Mike Jr
yes, sorry about that I don't have the CF admin pannel infront of me right now. Essentially, by turning that on, every DB call made by the page, will use the same open connection, then when the calls are done, the connection is closed. The opening and closing of connections per DB call creates significant overhead.
andrewWinn
A: 

database for sure. IMO registry is only viable when it is an intranet, internal system with < 20 users.

Henry
Seems like you've set pretty arbitrary boundaries, here. What about an intranet with 21 users? 25? 30? In the end, I think you're basing this opinion on the wrong factor. The Windows Registry is a messy hack to begin with, and trying to store transient data (client variables) there is just asking for problems. The registry, for example, is probably the 1 thing that never gets any sort of "clean up" when the machine slows down. The only way to clean it up is to reformat. </$0.02>
Adam Tuttle
A: 

If you are using client storage on linux, then the registry is out of the question since its use on *nix is not supported in ColdFusion.

Your only other options are a database or cookies.

Cookies will have limitations depending on the browser the user is using, if the user has cookies enabled or disabled, as well as security implications depending on what you are using the client storage for.

The database will most likely be the most efficient solution for client storage and scale out to clusters if high load is your concern.

Jayson
Although *nix does not have registry like Windows, CF still works with the default, clientstorage="registry" anyhow.
Henry
does it write the client storage to a text file, or log messages that the registry service is not available?
Jayson
@Jayson, I believe so.. something like that.
Henry
@Jayson "On UNIX systems, the registry entries are kept in /opt/coldfusion/registry/cf.registry, a text file that you can copy and edit directly."http://livedocs.adobe.com/coldfusion/8/htmldocs/sharedVars_09.html
Henry
+2  A: 

From http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&amp;file=00001154.htm

"Generally, it is most efficient to store client variables in a database. Although the Registry option is the default, the Registry has significant limitations for client data storage. The Registry cannot be used in clustered systems and its use for client variables on UNIX is not supported in ColdFusion MX."

Richard Davies