Skip to main content
September 5, 2012
Question

Client variables storage in production environment?

  • September 5, 2012
  • 1 reply
  • 965 views

Right now we are using Registry to store client variables in production environment, will changing it to Database increase the performance? or  what i heard from my colleague is that  In production environment , using Database for client storage is not advisable! how true is his statement.

This topic has been closed for replies.

1 reply

Miguel-F
Inspiring
September 5, 2012

His statement is completely wrong.  The docs talk about this here: http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec0c35c-7fd5.html

Specifically, read this paragraph from that reference:

Choosing a client variable storage method

By default, ColdFusion stores client variables in the Registry. In most cases, however, it is more appropriate to store the information as client cookies or in a SQL database.

The ColdFusion Administrator Client Variables page controls the default client variable location. You can override the default location by specifying a This.clientStorage value in Application.cfc or by setting the clientStorage attribute in thecfapplication tag.

You can specify the following values for the client storage method:

  • Registry (default). Client variables are stored under the key HKEY_LOCAL_MACHINE\ SOFTWARE\Macromedia\ColdFusion\CurrentVersion\Clients.
  • Name of a data source configured in ColdFusion Administrator
  • Cookie

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.

Carl Von Stetten
Legend
September 5, 2012

I'll add that if you are not on a Windows system, if you are using the Registry option then ColdFusion is writing out the Client variables to a flat file on the hard disk.  As this file grows, performance can drop off precipitously because the flat file is not indexed in any way.


If you are not storing more than a few "simple" datatypes in Client variables, then the cookie option is probably easiest.  Otherwise, using a database can provide excellent performance.