>- see footer for list info -< Well u have to remember CF is reading files all the time, every page, every include etc, so its no slower than that. Whereas database access has to connect to a remote machine, send the query, wait for response, transfer the data across the network, parse the SQL and then render the page.
Local filesystem vs remote file system. Russ -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of RichL Sent: 26 September 2006 16:16 To: Coldfusion Development Subject: Re: [CF-Dev] Sesson Scope in Multi-Server Env >- see footer for list info -< Thanks very much for that information Russ I have just done some tests saving and reading WDDX'd data using the DB method vs File method on both CFDeveloper and work servers - and the file method seemed to be about 25% of the time (i.e. significantly quicker) than the DB method Interesting stuff.. thanks v.much On 9/26/06, Snake <[EMAIL PROTECTED]> wrote: > >- see footer for list info -< > It depends what I'm doing. > I store simple values directly into client scope and complex data into > request scope, and the request scope is what gets WDDX'd and saved > with CFFILE. > I have a CFC that actually does the updates to the request scope, so > that it knows when any changes have occurred so it knows to update the wddx file. > It is usually a mix of storage mechanisms. > > Client scope = volatile data, that I don't need to keep or which is > loaded from a database when user logs in. > WDDX = persistent data that changes a lot which is not suitable for > client scope (such a complex data types or large amounts of text) > Database = profile data that rarely changes and is a read once/write > once process or can be loaded into client scope. > > I also use the WDDX method for global application configuration data. > So things like:- > > DSN, username, password, global email addresses, logical paths and > other application specific data. > As this stuff is usually needed for an application to work, I create a > WDDX file which is loaded and converted into structs and stored in request scope. > This means that the application is fully portable and you do not need > to edit code to get an app working when it is moved between servers. > So I have a version of the WDDX file for each server (live, dev and > staged), and the correct file is loaded according to the server name. > > Here is my application configuration loader routine. > > <cfset stagedservers = "staged.mydomain.com"> <cfset liveservers = > "mydomain.com,www.mydomain.com,secure.mydomain.com"> > <cfif ListFind(stagedservers. Server_name)> > <cfset whichServer = "staging"> <cfelseif ListFind(liveservers. > Server_name)> > <cfset whichServer="live"> > <cfelse> > <cfset whichServer = "dev"> > </cfif> > > <cfset encryptKey = ""><!--- the encryption key if used onthe wddx > file ---> <cfsavecontent variable="config"><cfinclude > template="../../secure/global_variables_#whichServer#.wddx"></cfsaveco > ntent> > <cfif encryptkey IS ""> > <!--- don't decrypt if no encryptkey provided ---> <cfwddx > action="WDDX2CFML" input="#config#" output="request.global"> <cfelse> > <!--- decrypt wddx packet ---> > <cfwddx action="WDDX2CFML" input="#Decrypt(config, encryptkey)#" > output="request.global"> > </cfif> > > -- > Russ > > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of RichL > Sent: 26 September 2006 15:11 > To: Coldfusion Development > Subject: Re: [CF-Dev] Sesson Scope in Multi-Server Env > > >- see footer for list info -< > Russ what syntax are you using to write to the file? CFFile? > > Are you writing the whole client scope or just a particular complex > var wddx'd up? > > > > On 9/26/06, Snake <[EMAIL PROTECTED]> wrote: > > >- see footer for list info -< > > Storing it in a file then is your best bet I think, cozz doing a > > cfinclude is going to be faster than querying lots of data from the > > database, especially if you have dumpted it in client scope as it > > loads on > every page. > > By dumping it in a file the only thing you load form the client > > variables if their userID or whatever unique identifier your using > > for > their session. > > You also have the advantage that the data will not expire, all they > > have to do it login again, and the file will be read. > > > > I have used this same method to restore someones session after a > > coldfusion crash. > > > > Russ > > > > -----Original Message----- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of RichL > > Sent: 26 September 2006 13:51 > > To: Coldfusion Development > > Subject: Re: [CF-Dev] Sesson Scope in Multi-Server Env > > > > >- see footer for list info -< > > OK thanks again guys... > > > > the other piece of information relative to this application is that > > there is a requirement to enable the user to leave the application > > at a certain page and return at a later date to continue the application.. > > > > given this fact, it looks essential to store the data supplied so > > far in a table somewhere. > > > > anyone supplying this information will have already logged in to the > > site and have a unique id.... so the thought was to wddx the data up > > and store it in a table along with the client's unique site id and > > if and when the user returns... query the table to see if they have > > any data already supplied > > > > the other issue then is the best way to pass the data from page to > > page in the app... the thinking is that after every page submission > > the data passed can be wddx'd up and written away at that stage... > > so that if the user closes the browser at that point we have their > > info saved > > > > sound sensible? > > > > On 9/26/06, Snake <[EMAIL PROTECTED]> wrote: > > > >- see footer for list info -< > > > I put the structures in request scope convert the structures into > > > WDDX or XML and store that in the client variable, and convert it > > > hack again when I need to read it. > > > If there is a LOT of data to store, I create a file for each > > > client (in a secure non web accessible folder).e.g. > > > > > > #client.userID#_data.wddx > > > > > > And then just read it back in the application.cfm > > > > > > E.g. > > > > > > <cfsavecontent variable="request.client"> <cfinclude > > > template="#ExpandPath('../secure/clientvars/')##client.userID#_data. > > > wd > > > dx"> > > > </cfsavecontent> > > > <cfwddx action="WDDX2CFML" input="#clientvars#" > > > output="request.client"> > > > > > > Voila > > > Simple and also fast > > > > > > Russ > > > > > > -----Original Message----- > > > From: [EMAIL PROTECTED] > > > [mailto:[EMAIL PROTECTED] On Behalf Of RichL > > > Sent: 26 September 2006 11:53 > > > To: Coldfusion Development > > > Subject: Re: [CF-Dev] Sesson Scope in Multi-Server Env > > > > > > >- see footer for list info -< > > > Thank you for the info guys > > > > > > Russ... how do you approach this in the case of complex variables? > > > client variables are generally used for simple data aren't they? > > > > > > On 9/26/06, Snake <[EMAIL PROTECTED]> wrote: > > > > >- see footer for list info -< > > > > I use client variables :-) > > > > > > > > Sticky sessions just doesn't work properly on a jrun cluster, so > > > > it is much easier to use client vars and not have to worry about > > > > that > > problem. > > > > > > > > Russ > > > > -----Original Message----- > > > > From: [EMAIL PROTECTED] > > > > [mailto:[EMAIL PROTECTED] On Behalf Of RichL > > > > Sent: 26 September 2006 09:42 > > > > To: cfdev > > > > Subject: [CF-Dev] Sesson Scope in Multi-Server Env > > > > > > > > >- see footer for list info -< > > > > I am in the process of developing new applications from scratch > > > > > > > > I need to move data around several pages of an app with all data > > > > relating to the current user accessible from each page in the > > > > application > > > > > > > > The obvious choice for me would be to use session scope but > > > > after speaking to permanent members of staff here they are > > > > advising not so use this as sessions need to be sticky as it is > > > > a 4 server clustered environment... and they are advising > > > > against it because it can be messy/tricky > > > > > > > > On my last application developed here I resorted to passing data > > > > around in wddx from page to page and even writing to DB where > necessary. > > > > > > > > My thoughts are that needing/wanting to use session scope > > > > variables in a multi-server environment must be quite a common > requirement... > > > > so how do other people approach this situation? > > > > > > > > Thanks > > > > > > > > -- > > > > Rich > > > > _______________________________________________ > > > > > > > > For details on ALL mailing lists and for joining or leaving > > > > lists, go to http://list.cfdeveloper.co.uk/mailman/listinfo > > > > > > > > -- > > > > CFDeveloper Sponsors:- > > > > >- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -< > > > > >- Lists hosted by www.Gradwell.com -< > > > > >- CFdeveloper is run by Russ Michaels, feel free to volunteer > > > > >your help -< > > > > > > > > > > > > _______________________________________________ > > > > > > > > For details on ALL mailing lists and for joining or leaving > > > > lists, go to http://list.cfdeveloper.co.uk/mailman/listinfo > > > > > > > > -- > > > > CFDeveloper Sponsors:- > > > > >- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -< > > > > >- Lists hosted by www.Gradwell.com -< > > > > >- CFdeveloper is run by Russ Michaels, feel free to volunteer > > > > >your help -< > > > > > > > > > > > > > -- > > > Rich > > > _______________________________________________ > > > > > > For details on ALL mailing lists and for joining or leaving lists, > > > go to http://list.cfdeveloper.co.uk/mailman/listinfo > > > > > > -- > > > CFDeveloper Sponsors:- > > > >- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -< > > > >- Lists hosted by www.Gradwell.com -< > > > >- CFdeveloper is run by Russ Michaels, feel free to volunteer > > > >your help -< > > > > > > > > > _______________________________________________ > > > > > > For details on ALL mailing lists and for joining or leaving lists, > > > go to http://list.cfdeveloper.co.uk/mailman/listinfo > > > > > > -- > > > CFDeveloper Sponsors:- > > > >- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -< > > > >- Lists hosted by www.Gradwell.com -< > > > >- CFdeveloper is run by Russ Michaels, feel free to volunteer > > > >your help -< > > > > > > > > > -- > > Rich > > _______________________________________________ > > > > For details on ALL mailing lists and for joining or leaving lists, > > go to http://list.cfdeveloper.co.uk/mailman/listinfo > > > > -- > > CFDeveloper Sponsors:- > > >- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -< > > >- Lists hosted by www.Gradwell.com -< > > >- CFdeveloper is run by Russ Michaels, feel free to volunteer your > > >help -< > > > > > > _______________________________________________ > > > > For details on ALL mailing lists and for joining or leaving lists, > > go to http://list.cfdeveloper.co.uk/mailman/listinfo > > > > -- > > CFDeveloper Sponsors:- > > >- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -< > > >- Lists hosted by www.Gradwell.com -< > > >- CFdeveloper is run by Russ Michaels, feel free to volunteer your > > >help -< > > > > > -- > Rich > _______________________________________________ > > For details on ALL mailing lists and for joining or leaving lists, go > to http://list.cfdeveloper.co.uk/mailman/listinfo > > -- > CFDeveloper Sponsors:- > >- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -< > >- Lists hosted by www.Gradwell.com -< > >- CFdeveloper is run by Russ Michaels, feel free to volunteer your > >help -< > > > _______________________________________________ > > For details on ALL mailing lists and for joining or leaving lists, go > to http://list.cfdeveloper.co.uk/mailman/listinfo > > -- > CFDeveloper Sponsors:- > >- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -< > >- Lists hosted by www.Gradwell.com -< > >- CFdeveloper is run by Russ Michaels, feel free to volunteer your > >help -< > -- Rich _______________________________________________ For details on ALL mailing lists and for joining or leaving lists, go to http://list.cfdeveloper.co.uk/mailman/listinfo -- CFDeveloper Sponsors:- >- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -< >- Lists hosted by www.Gradwell.com -< >- CFdeveloper is run by Russ Michaels, feel free to volunteer your help >-< _______________________________________________ For details on ALL mailing lists and for joining or leaving lists, go to http://list.cfdeveloper.co.uk/mailman/listinfo -- CFDeveloper Sponsors:- >- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -< >- Lists hosted by www.Gradwell.com -< >- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<
