session vs. client scope (clustering)
Hey guys, In my applications, I have always used the session scope for handy things like storing the currently logged in user, so I can just do: user.isLoggedIn() ... user.hasRole(admin), things like that. It's great! Here at my current gig, though, they have a clustered server configuration so they are using client variables rather than the session scope. In configurations like this (which certainly must be very common), is there a standard best practice? If I wanted to have a user object available on every page request, for example, would I need to serialize and deserialize it w/ wddx on every request (seems nasty), or perhaps I just store the userID in client.userID and at the start of every request call userService.getUserById(client.userID) (seems like extra overhead), or maybe I should look into something like sticky sessions? I have experience in application design, but not as much with server configuration and clustering so I'm not sure how this is normally solved. Thanks in advance for your insight! ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357074 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: session vs. client scope (clustering)
In my applications, I have always used the session scope for handy things like storing the currently logged in user, so I can just do: user.isLoggedIn() ... user.hasRole(admin), things like that. It's great! Here at my current gig, though, they have a clustered server configuration so they are using client variables rather than the session scope. In configurations like this (which certainly must be very common), is there a standard best practice? If I wanted to have a user object available on every page request, for example, would I need to serialize and deserialize it w/ wddx on every request (seems nasty), or perhaps I just store the userID in client.userID and at the start of every request call userService.getUserById(client.userID) (seems like extra overhead), or maybe I should look into something like sticky sessions? There isn't really anything that rises to the level of a best practice here. Instead, different application environments have different desired outcomes. Are you using clustering to support a larger number of users than a single server? Or are you using it to provide failover in case a server fails? Or both? If the former, there's nothing wrong with using sticky sessions, and you won't have to change your code. If the latter, you have two choices. You could use the Client scope as described above, or you could set up session replication between the servers. Session replication would let you continue using the same approach in your code, but is somewhat difficult and fragile, so I try to avoid using it. On the other hand, the Client scope is slower, and requires the serialization approach you describe if you want to use objects. That said, it usually performs adequately, and while the serialization may seem nasty, you don't typically have to revisit this code once it's written, and you can hide it away from your actual implementation of objects. I'm not sure where your userService object would live on a cluster of servers, in a way that would allow it to have the same data, without doing things of equal or greater nastiness. So I'd probably just serialize objects, but I'd want to make sure that I'm not storing too much in these objects due to the overhead of this process. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357079 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: session vs. client scope (clustering)
client variables are pretty rubbish as they can only hold simple values. If that is all you need it for, then perhaps use it, but I would restricr usage to COOKIE storage, registry should be avoided at all cost, and database storage can really put a lot of extra load on the database and delays on execution time. If your cluster is setup properly then it will be using sticky sessions anyway, so speak with sysadmin and ask him. you may want to read this http://www.dopefly.com/pages/ColdFusionClientVariablesFinalNail.cfm On Fri, Nov 15, 2013 at 2:41 PM, Brian FitzGerald bmfitzgera...@yahoo.comwrote: Hey guys, In my applications, I have always used the session scope for handy things like storing the currently logged in user, so I can just do: user.isLoggedIn() ... user.hasRole(admin), things like that. It's great! Here at my current gig, though, they have a clustered server configuration so they are using client variables rather than the session scope. In configurations like this (which certainly must be very common), is there a standard best practice? If I wanted to have a user object available on every page request, for example, would I need to serialize and deserialize it w/ wddx on every request (seems nasty), or perhaps I just store the userID in client.userID and at the start of every request call userService.getUserById(client.userID) (seems like extra overhead), or maybe I should look into something like sticky sessions? I have experience in application design, but not as much with server configuration and clustering so I'm not sure how this is normally solved. Thanks in advance for your insight! ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357080 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: session load balancing [WAS Re: Pros/Cons Session vs Client scope]
I'll try...been a few months since I saw the issue. We have a JRun cluster of two instances ecah running CF6. A request for a graph in CF generates a swf and a graph id. The swf is requested via a call to /cfide/graph.cfm IIRC, with the graph id in the HTML on the resulting page. This graph id is not unique but is kind of unique to the CF instance. Thus if you have sticky sessions set to off, a user request to a cfm page that has a cfgraph in it may hit server A for the cfm page but hit server B for the swf request. But A generated the swf and ID and thus does not exist on B. That about sums it up. Now, I actually setup a central CFIDE folder for both CF server A and B to see, but this didn't help. CF has some sort of internal numbering for each graph. DK On 11/27/05, Andrew Stevens [EMAIL PROTECTED] wrote: Douglas, can you elaborate on this point? Cheers, AS -Original Message- From: Douglas Knudsen [mailto:[EMAIL PROTECTED] Sent: Saturday, 26 November 2005 4:46 AM To: CF-Talk Subject: Re: session load balancing [WAS Re: Pros/Cons Session vs Client scope] I'll point out that if you have a CF(JRun) cluster set to use non-sticky sessions this will kill use of CF Graphing. AFAIK, there is no work around. Just an FYI DK On 11/25/05, John Paul Ashenfelter [EMAIL PROTECTED] wrote: On 11/23/05, Dave Watts [EMAIL PROTECTED] wrote: How do you span sessions across ColdFusion servers if you aren't using Enterprise? You don't. Isn't it all a matter of how you cluster the machines though? I mean, if you want to use sessions in a clustered environment, you just need to make sure that your load balancer uses sticky sessions. Basically, the goal is not to ever toss users between servers, but just assign users to a server based on the load balancing parameters when they first land on your site. If you do that, you aren't spanning sessions across CF servers. This approach is often referred to as sticky sessions. If you use sticky sessions, you don't get failover, only load-balancing. This may or may not be acceptable, depending on your business needs and general server stability. Furthermore, you get a less powerful version of load-balancing -- incoming initial user sessions are balanced according to load (or whatever balancing scheme is being used) but once the user is *on* a server, they're on it for the sessions (thus the sticky). So if a server slows down b/c of a runaway process for example, *new* users get balanced to the less loaded servers, but the folks on the server with the slowdown are stuck. This is in contrast to active loadbalancing without sticky sessions where the user gets the least loaded server (or whatever is set in the balancing rubric) on *every* request. As an aside, implementing session-aware clustering can actually degrade performance, even when done right. Using files to store session for example, is a common approach in both the LAMP stack and RubyOnRails for scaling horizontally across N servers -- but your chokepoint becomes the SAN or whatever storing the data. Even more advanced solutions like memcached (eg LiveJournal and Slashdot) or J2EE session clustering (eg CFMX) have problems b/c replicating data between multiple nodes takes time when the data is very active. It's always a balance of reliability vs performance. -- John Paul Ashenfelter CTO/Transitionpoint (blog) http://www.ashenfelter.com (email) [EMAIL PROTECTED] ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225327 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: session load balancing [WAS Re: Pros/Cons Session vs Client scope]
Douglas, can you elaborate on this point? Cheers, AS -Original Message- From: Douglas Knudsen [mailto:[EMAIL PROTECTED] Sent: Saturday, 26 November 2005 4:46 AM To: CF-Talk Subject: Re: session load balancing [WAS Re: Pros/Cons Session vs Client scope] I'll point out that if you have a CF(JRun) cluster set to use non-sticky sessions this will kill use of CF Graphing. AFAIK, there is no work around. Just an FYI DK On 11/25/05, John Paul Ashenfelter [EMAIL PROTECTED] wrote: On 11/23/05, Dave Watts [EMAIL PROTECTED] wrote: How do you span sessions across ColdFusion servers if you aren't using Enterprise? You don't. Isn't it all a matter of how you cluster the machines though? I mean, if you want to use sessions in a clustered environment, you just need to make sure that your load balancer uses sticky sessions. Basically, the goal is not to ever toss users between servers, but just assign users to a server based on the load balancing parameters when they first land on your site. If you do that, you aren't spanning sessions across CF servers. This approach is often referred to as sticky sessions. If you use sticky sessions, you don't get failover, only load-balancing. This may or may not be acceptable, depending on your business needs and general server stability. Furthermore, you get a less powerful version of load-balancing -- incoming initial user sessions are balanced according to load (or whatever balancing scheme is being used) but once the user is *on* a server, they're on it for the sessions (thus the sticky). So if a server slows down b/c of a runaway process for example, *new* users get balanced to the less loaded servers, but the folks on the server with the slowdown are stuck. This is in contrast to active loadbalancing without sticky sessions where the user gets the least loaded server (or whatever is set in the balancing rubric) on *every* request. As an aside, implementing session-aware clustering can actually degrade performance, even when done right. Using files to store session for example, is a common approach in both the LAMP stack and RubyOnRails for scaling horizontally across N servers -- but your chokepoint becomes the SAN or whatever storing the data. Even more advanced solutions like memcached (eg LiveJournal and Slashdot) or J2EE session clustering (eg CFMX) have problems b/c replicating data between multiple nodes takes time when the data is very active. It's always a balance of reliability vs performance. -- John Paul Ashenfelter CTO/Transitionpoint (blog) http://www.ashenfelter.com (email) [EMAIL PROTECTED] ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225322 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
session load balancing [WAS Re: Pros/Cons Session vs Client scope]
On 11/23/05, Dave Watts [EMAIL PROTECTED] wrote: How do you span sessions across ColdFusion servers if you aren't using Enterprise? You don't. Isn't it all a matter of how you cluster the machines though? I mean, if you want to use sessions in a clustered environment, you just need to make sure that your load balancer uses sticky sessions. Basically, the goal is not to ever toss users between servers, but just assign users to a server based on the load balancing parameters when they first land on your site. If you do that, you aren't spanning sessions across CF servers. This approach is often referred to as sticky sessions. If you use sticky sessions, you don't get failover, only load-balancing. This may or may not be acceptable, depending on your business needs and general server stability. Furthermore, you get a less powerful version of load-balancing -- incoming initial user sessions are balanced according to load (or whatever balancing scheme is being used) but once the user is *on* a server, they're on it for the sessions (thus the sticky). So if a server slows down b/c of a runaway process for example, *new* users get balanced to the less loaded servers, but the folks on the server with the slowdown are stuck. This is in contrast to active loadbalancing without sticky sessions where the user gets the least loaded server (or whatever is set in the balancing rubric) on *every* request. As an aside, implementing session-aware clustering can actually degrade performance, even when done right. Using files to store session for example, is a common approach in both the LAMP stack and RubyOnRails for scaling horizontally across N servers -- but your chokepoint becomes the SAN or whatever storing the data. Even more advanced solutions like memcached (eg LiveJournal and Slashdot) or J2EE session clustering (eg CFMX) have problems b/c replicating data between multiple nodes takes time when the data is very active. It's always a balance of reliability vs performance. -- John Paul Ashenfelter CTO/Transitionpoint (blog) http://www.ashenfelter.com (email) [EMAIL PROTECTED] ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225247 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Pros/Cons Session vs Client scope
On 11/23/05, Jeff Chastain [EMAIL PROTECTED] wrote: This was my thought as well. Basically, the worst that would happen is that a user might have to log in again if the server they were 'stuck' to went down and they were shifted to a different server. In some applications this could be a problem, but I expect it would not be for most. Is this correct? If the session data was really important (a purchase), then you've lost the work done during the last request (entering payment information) *and* made the user much less confident in your site. Of course a simpler solution than session-clustering to this problem is to not require sessions for the purchase process :) -- John Paul Ashenfelter CTO/Transitionpoint (blog) http://www.ashenfelter.com (email) [EMAIL PROTECTED] ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225248 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: session load balancing [WAS Re: Pros/Cons Session vs Client scope]
I'll point out that if you have a CF(JRun) cluster set to use non-sticky sessions this will kill use of CF Graphing. AFAIK, there is no work around. Just an FYI DK On 11/25/05, John Paul Ashenfelter [EMAIL PROTECTED] wrote: On 11/23/05, Dave Watts [EMAIL PROTECTED] wrote: How do you span sessions across ColdFusion servers if you aren't using Enterprise? You don't. Isn't it all a matter of how you cluster the machines though? I mean, if you want to use sessions in a clustered environment, you just need to make sure that your load balancer uses sticky sessions. Basically, the goal is not to ever toss users between servers, but just assign users to a server based on the load balancing parameters when they first land on your site. If you do that, you aren't spanning sessions across CF servers. This approach is often referred to as sticky sessions. If you use sticky sessions, you don't get failover, only load-balancing. This may or may not be acceptable, depending on your business needs and general server stability. Furthermore, you get a less powerful version of load-balancing -- incoming initial user sessions are balanced according to load (or whatever balancing scheme is being used) but once the user is *on* a server, they're on it for the sessions (thus the sticky). So if a server slows down b/c of a runaway process for example, *new* users get balanced to the less loaded servers, but the folks on the server with the slowdown are stuck. This is in contrast to active loadbalancing without sticky sessions where the user gets the least loaded server (or whatever is set in the balancing rubric) on *every* request. As an aside, implementing session-aware clustering can actually degrade performance, even when done right. Using files to store session for example, is a common approach in both the LAMP stack and RubyOnRails for scaling horizontally across N servers -- but your chokepoint becomes the SAN or whatever storing the data. Even more advanced solutions like memcached (eg LiveJournal and Slashdot) or J2EE session clustering (eg CFMX) have problems b/c replicating data between multiple nodes takes time when the data is very active. It's always a balance of reliability vs performance. -- John Paul Ashenfelter CTO/Transitionpoint (blog) http://www.ashenfelter.com (email) [EMAIL PROTECTED] ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225260 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Pros/Cons Session vs Client scope
Does anyone have thoughts on pros/cons of client vs Session scope? I currently use client scope primarily but if cookies are disabled it blows up. Any thoughts on switching? Other topic anyone have suggestions for a good horizontal Javascript or DHTML news ticker? Thank you and Happy Thanksgiving: Daron Smith PSEA ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225071 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Pros/Cons Session vs Client scope
Pros Allows for persistant variables through clustered servers without having to purchase ColdFusion Enterprise Cons The bottleneck of your application is to your database server. You just added a hit to every persistant variable to your database. This makes your application much slower than if you were to use memory variables. Database size. The database gets very large, very fast. Bob ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225072 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Pros/Cons Session vs Client scope
I wrote something on client variables a little while ago: http://www.dopefly.com/techblog/entry.cfm?entry=77 It's a good read, with some good comments too. -nathan strutz http://www.dopefly.com/ On 11/23/05, Smith, Daron [PA] [EMAIL PROTECTED] wrote: Does anyone have thoughts on pros/cons of client vs Session scope? I currently use client scope primarily but if cookies are disabled it blows up. Any thoughts on switching? Other topic anyone have suggestions for a good horizontal Javascript or DHTML news ticker? Thank you and Happy Thanksgiving: Daron Smith PSEA ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225073 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Pros/Cons Session vs Client scope
Nathan, You raise some good points. In your opinion if I'm not running in a clustered environment, are session variables the way to go? Anyone else have thoughts? I wrote something on client variables a little while ago: http://www.dopefly.com/techblog/entry.cfm?entry=77 It's a good read, with some good comments too. -nathan strutz http://www.dopefly.com/ On 11/23/05, Smith, Daron [PA] [EMAIL PROTECTED] wrote: ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225076 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Pros/Cons Session vs Client scope
I would venture to say that if you are or are not running in a clustered environment, client variables are the wrong way to go. As for changing your current aps, I'd say only do it if you begin to see problems. When the load on your servers increase, make sure you're monitoring general CPU usage on your servers, and take note if anything becomes unstable. Client variables should be the first thing to fix on your list. Realistically, most sites don't get enough traffic to warrant a change. Your original email mentioned that when cookies are disabled, it all blows up. The same thing happens with sessions, but with those, you can set a session cookie (one that expires when the browser closes). These cookies are very rarely blocked. You can turn them on by switching on jsessionids in your cf admin, or you can manually do it (google it) -nathan strutz http://www.dopefly.com/ On 11/23/05, dsmith @ psea. org dsmith @ psea. org [EMAIL PROTECTED] wrote: Nathan, You raise some good points. In your opinion if I'm not running in a clustered environment, are session variables the way to go? Anyone else have thoughts? I wrote something on client variables a little while ago: http://www.dopefly.com/techblog/entry.cfm?entry=77 It's a good read, with some good comments too. -nathan strutz http://www.dopefly.com/ On 11/23/05, Smith, Daron [PA] [EMAIL PROTECTED] wrote: ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225080 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Pros/Cons Session vs Client scope
On 11/23/05, dsmith @ psea. org dsmith @ psea. org [EMAIL PROTECTED] wrote: Nathan, You raise some good points. In your opinion if I'm not running in a clustered environment, are session variables the way to go? Anyone else have thoughts? The answer is very dependent upon details of the application -- session uses memory on the server, client involves an additional database hit. Right answer depends on the load on the application -- but for a smaller app, it shouldn't be a big deal for either. Default CFMX session behavior blows up if you have cookies disabled as well -- J2EE sessions can help with that. As an aside, one enormous difference between client and session is that you can't store any complex data types -- no structures, arrays, etc -- only text (which in CF includes numbers, dates, etc). The *fix* for that is to use WDDX to read/write your structs/arrays/etc to text and store that in client scope, though that adds even more overhead. While this sounds like it's pushing you towards session, it doesn't have to be quite so black-and-white. I built an app two years ago for a company that wanted to be able to scale quickly without buying CF enterprise -- so the mandate was to use client-scoped variables. The app has a *lot* of structures/arrays that needed to be persistent, so that's lots of WDDX data (including the entire shopping cart which generally has 30-50 items in it) and a lot of transfer back/forth to the database. On every hit. Knowing that at some point moving to session was almost a given, I did some simple information-hiding so that the code doesn't know anything about session/client scope for persistent variables -- at the beginning of each request (Application.cfm, though in FB4.1 I used a global prefuseaction) I pulled all the data out of the persistent store (client scope wddx data in this instance) and copied it to variables scope (though you could probably use request if you wished). Once all of the processing was done, I wrote the data back to the persistent store at the end (OnRequestEnd.cfm, though I used FB4.1's global postfuseaction instead). What this meant was that if we moved from client to session, the application doesn't know anything changed. I could change the process to pull the data from multiple places (some in session, some in client, some pulled out of the db directly) as long as the resulting output all went into variables scope. Did I add overhead -- sure, a minor bit (esp compared to WDDXing a lot of data and pushing it to client scope) but the app is much more maitainable and flexible. Turns out the application still runs on a single vanilla dell server -- it never hit the massive load they thought, though it still runs 50k-100k of business/week. And it still handles the persistent data in client scope, though changing it to session would require tweaking code in precisely two places. My real point is that a clean app design can let you switch between the scopes as appropriate (heck, global search/replace from client. to session. would probably work as well). It's not bad to think about the design up front, but it's not hard to handle changes gracefully either. -- John Paul Ashenfelter CTO/Transitionpoint (blog) http://www.ashenfelter.com (email) [EMAIL PROTECTED] ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225081 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Pros/Cons Session vs Client scope
Starting with CF6 you can use session vars with a cluster, yes? Don't you have to use jrun sessions or something? -- --mattRobertson-- Janitor, MSB Web Systems mysecretbase.com ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225082 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Pros/Cons Session vs Client scope
I didn't think they had sorted that entirely - like clustering CFC's for example. -Original Message- From: Matt Robertson [mailto:[EMAIL PROTECTED] Sent: 23 November 2005 16:10 To: CF-Talk Subject: Re: Pros/Cons Session vs Client scope Starting with CF6 you can use session vars with a cluster, yes? Don't you have to use jrun sessions or something? -- --mattRobertson-- Janitor, MSB Web Systems mysecretbase.com ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225083 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Pros/Cons Session vs Client scope
I think there are quite a few variables that need to be considered as others have mentioned. I always use session scope on my internal work servers. If on a shared server, one thing to keep in mind is that any other developer on that box can see your session variables. Not good if dealing with personal data. T Does anyone have thoughts on pros/cons of client vs Session scope? I currently use client scope primarily but if cookies are disabled it blows up. Any thoughts on switching? Other topic anyone have suggestions for a good horizontal Javascript or DHTML news ticker? Thank you and Happy Thanksgiving: Daron Smith PSEA ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225090 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Pros/Cons Session vs Client scope
yes, but CFCs in the session scope can't be shared in a cluster. Note, if you have a sticky session cluster setup, then this works fine, eh? DK On 11/23/05, Matt Robertson [EMAIL PROTECTED] wrote: Starting with CF6 you can use session vars with a cluster, yes? Don't you have to use jrun sessions or something? -- --mattRobertson-- Janitor, MSB Web Systems mysecretbase.com ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225091 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Pros/Cons Session vs Client scope
How do you span sessions across ColdFusion servers if you aren't using Enterprise? Why would you even put CFC's into a session scope? Shouldn't they be in the application scope? Bob ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225114 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Pros/Cons Session vs Client scope
How do you span sessions across ColdFusion servers if you aren't using Enterprise? More-knowledgeable people will need to answer this one. Why would you even put CFC's into a session scope? Shouldn't they be in the application scope? When a user logs in to your site, you can create a session-based CFC. That CFC will hold personal information for that user. Session-based CFCs are great for any system that requires a login. M!ke ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225117 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Pros/Cons Session vs Client scope
How do you span sessions across ColdFusion servers if you aren't using Enterprise? I've never done this in CF but have in ASP. In the earlier days of the web the mandate for places I worked was never use session variables. So I have always coded without using them. There was always someone who wanted to stuff every thing they could in there so we developed a begintran and endtran function that would loop through the session and create a cookie. This would also allow for the user to be sticky. Essentially something like this, although this is ASP Function Begin_Tran() strCookies = Request.Cookies(foo) Response.Cookies(foo) = startPos = 1 tildePos = InStr(startPos, strCookies, ~) Do While InStr(startPos, strCookies, ~) caratPos = InStr(startPos,strCookies,^) tildePos = InStr(startPos,strCookies,~) varName = Mid(strCookies,startPos,caratPos - startPos) varValue = Mid(strCookies,caratPos + 1,tildePos - caratPos - 1) startPos = tildePos + 1 Session(varName) = varValue Loop End Function Function end_tran() Dim strCookies, objItem, strValue For Each objItem in Session.Contents strValue = Replace(Replace(Session.Contents(objItem),~,),^,) strCookies = strCookies objItem ^ strValue ~ Next Response.Cookies(foo) = strCookies Response.Cookies(foo).Path = / Session.Contents.RemoveAll End Function -Original Message- From: Dawson, Michael [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 23, 2005 2:56 PM To: CF-Talk Subject: RE: Pros/Cons Session vs Client scope How do you span sessions across ColdFusion servers if you aren't using Enterprise? More-knowledgeable people will need to answer this one. Why would you even put CFC's into a session scope? Shouldn't they be in the application scope? When a user logs in to your site, you can create a session-based CFC. That CFC will hold personal information for that user. Session-based CFCs are great for any system that requires a login. M!ke ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225118 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Pros/Cons Session vs Client scope
When a user logs in to your site, you can create a session-based CFC. That CFC will hold personal information for that user. Session-based CFCs are great for any system that requires a login. Why wouldn't you just create a structure with that information in it? I don't understand why you would create a CFC for the user information. Can you explain in more detail. Bob ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225119 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Pros/Cons Session vs Client scope
How do you span sessions across ColdFusion servers if you aren't using Enterprise? You don't. Why would you even put CFC's into a session scope? Shouldn't they be in the application scope? CFCs are just variables, like any others really. You put user-specific variables in the Session or Client scopes. Of course, you can't put CFCs in the Client scope, and you can't use CFCs in the Session scope in a session-aware cluster. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225120 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Pros/Cons Session vs Client scope
Isn't it all a matter of how you cluster the machines though? I mean, if you want to use sessions in a clustered environment, you just need to make sure that your load balancer uses sticky sessions. Basically, the goal is not to ever toss users between servers, but just assign users to a server based on the load balancing parameters when they first land on your site. --Ferg Dave Watts wrote: How do you span sessions across ColdFusion servers if you aren't using Enterprise? You don't. ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225128 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Pros/Cons Session vs Client scope
I understand that CFC's are just like any other variables. My question is, why? I have used CFC's mostly to put functions that are used throughout an application into the application scope. So what would you put a CFC into a session scope for? What is that person doing different that makes it necessary to put it into a session. Bob ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225134 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Pros/Cons Session vs Client scope
Why wouldn't you just create a structure with that information in it? I don't understand why you would create a CFC for the user information. Can you explain in more detail. CFCs allow you to create variables that are objects - that contain both data and code, and can manipulate their own data through the code they contain. This allows what many people consider a more intuitive way to write applications. For example, in a shopping cart application, you could store the cart data as simply data within a variable, or you could have a cart object that contains the data, but also contains methods to calculate totals, add and remove items, and so on. This allows you to more easily separate various kinds of logic within your programs in useful ways. The best way to answer your question would really be to advise you to read about object-oriented programming, I think. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225136 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Pros/Cons Session vs Client scope
I understand that CFC's are just like any other variables. My question is, why? I have used CFC's mostly to put functions that are used throughout an application into the application scope. So what would you put a CFC into a session scope for? What is that person doing different that makes it necessary to put it into a session. Bob When you start putting functions and data into you cfc's then it makes since to create a user cfc in session scope. This cfc will likely store information about a user such as name, last time logged in, shopping cart, permissions, ect. as well as all the appropriate functions to add, edit and persist this data. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225137 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Pros/Cons Session vs Client scope
Something to read that may help: http://www.horwith.com/index.cfm?mode=entryentry=59710A68-E081-0478-475D659 34BEA80CD ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225138 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Pros/Cons Session vs Client scope
On 11/23/05, Robert Everland III [EMAIL PROTECTED] wrote: I understand that CFC's are just like any other variables. My question is, why? I have used CFC's mostly to put functions that are used throughout an application into the application scope. You're using CFCs as a way to wrap up related functions (which is fine but not what objects are all about). So what would you put a CFC into a session scope for? What is that person doing different that makes it necessary to put it into a session. A shopping cart CFC wraps up data (what's in the cart) and functions (add / remove items from the cart) and something like that would typically live in session scope. Similarly for a user CFC (user data + functions that operate on it). As for client scope, I disable it by default as part of server setup (i.e., set the default client storage to none - and none of my apps use client scope). I use J2EE session variables instead so that persistent cookies are not automatically created and stored on the user's computer. I also use sticky session so I don't have to deal with session replication (network overhead if you have a lot of sessions with active data). -- Sean A Corfield -- http://corfield.org/ Got frameworks? If you're not annoying somebody, you're not really alive. -- Margaret Atwood ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225139 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Pros/Cons Session vs Client scope
How do you span sessions across ColdFusion servers if you aren't using Enterprise? You don't. Isn't it all a matter of how you cluster the machines though? I mean, if you want to use sessions in a clustered environment, you just need to make sure that your load balancer uses sticky sessions. Basically, the goal is not to ever toss users between servers, but just assign users to a server based on the load balancing parameters when they first land on your site. If you do that, you aren't spanning sessions across CF servers. This approach is often referred to as sticky sessions. If you use sticky sessions, you don't get failover, only load-balancing. This may or may not be acceptable, depending on your business needs and general server stability. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225142 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Pros/Cons Session vs Client scope
Structs can easily be modified. CFCs, without the setters, cannot easily be modified. Sure you can, but not usually accidentally. Also, the CFCs, will pass around their logic. Structures are just dumb. You could probably do it either way. I just like the feeling that CFCs control my data just a bit better than a struct would. M!ke -Original Message- From: Robert Everland III [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 23, 2005 1:21 PM To: CF-Talk Subject: Re: Pros/Cons Session vs Client scope When a user logs in to your site, you can create a session-based CFC. That CFC will hold personal information for that user. Session-based CFCs are great for any system that requires a login. Why wouldn't you just create a structure with that information in it? I don't understand why you would create a CFC for the user information. Can you explain in more detail. Bob ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225143 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Pros/Cons Session vs Client scope
This was my thought as well. Basically, the worst that would happen is that a user might have to log in again if the server they were 'stuck' to went down and they were shifted to a different server. In some applications this could be a problem, but I expect it would not be for most. Is this correct? -- Jeff -Original Message- From: Ken Ferguson [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 23, 2005 2:41 PM To: CF-Talk Subject: Re: Pros/Cons Session vs Client scope Isn't it all a matter of how you cluster the machines though? I mean, if you want to use sessions in a clustered environment, you just need to make sure that your load balancer uses sticky sessions. Basically, the goal is not to ever toss users between servers, but just assign users to a server based on the load balancing parameters when they first land on your site. --Ferg ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225154 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Session vs. Client Variables
Hello all... Next month I'm beginning a complete rewrite of a site that gets about 120,000 page views per day. For background, here is our server configuration: CFMX 6.1 Enterprise, J2EE Configuration for JRun 2 Windows 2003 Servers with 4 GB RAM for IIS and JRun/CFMX MS SQL 2000 on a separate Windows Server 2003 Hardware Load Balancer This site has one JRun instance on each server joined in a cluster Session Replication is enabled Both CFMX and JRun have the latest updaters installed (There are 5 more instances of JRun on each server running smaller, lower traffic sites) The site requires tracking a small amount of demographic information (zipcode, etc) throughout the entire user's session. There is also a login for contest/poll entry, managing subscriptions, access to certain types of content, etc. All of this MUST work if the user has cookies disabled in their browser. (I use URLSessionFormat() for all links). I'm getting conflicting reports on which is best for this scenario: Session Variables or Client Variables I know Session Replication is faster, but it's been a little flakey since we started using JRun clusters... especially due to a bug where when a JRun instance is brought back online, the session is dropped and the user gets a new one. (Macromedia is supposed to be fixing that one soon). But as a test, I tried switching to client variables (using database) and we took a serious performance hit (probably 50%) with the current application. I'll do my best to streamline it during the rewrite, but does anyone have any suggestions on the best route to take here? Thanks, Jonathan _ Jonathan Mauney Web Application Developer/Manager, Digital Media Properties News Talk 1110 WBT/107.9 the LINK/PersonalityAC(r) Radio Network Jefferson-Pilot Communications Co. ~| Special thanks to the CF Community Suite Silver Sponsor - RUWebby http://www.ruwebby.com Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188991 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Session vs. Client Variables
We just switched away from client variables, and now use only session variables. We got an enormous increase in performance. The database guys were complaining about the performance impace from all the reads -- let alone the writes -- due to storing variables in the database. Recall that CFMX (like CF before it) reads all the user's client variables at the beginning of any HTTP Request that uses even one client variable. All the user's client variables are then written back to the database at the end of that HTTP Request. We definitely experienced some issues with scaling. (CFMX for J2EE, WebSphere, Oracle 10g, 3,000 to 4,000 concurrent users, database-intensive application) Chris Norloff -- Original Message -- From: [EMAIL PROTECTED] ... But as a test, I tried switching to client variables (using database) and we took a serious performance hit (probably 50%) with the current application. I'll do my best to streamline it during the rewrite, but does anyone have any suggestions on the best route to take here? Thanks, Jonathan ... ~| Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net http://www.cfhosting.net Message: http://www.houseoffusion.com/lists.cfm/link=i:4:189007 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
SESSION vs. CLIENT
We're working in a clustered environment (eight servers in one pool, two in several others) on Windows 2000/IIS 5.0 behind a BigIP load balancer with some CF5 and some CFMX. (Very soon to go all CFMX.) We use Session variables extensively to keep track of user's logon information, which has required us to use stick sessions on the load balancer to keep users stuck to a server. However, we've gone through several exercises with certain customers because of the way their proxy servers/firewall block or trap cookies or other issues. I have suggested that if we were to go to Client variables in a database for that information we would remove the need for sticky sessions. The argument against me has always been that a database transaction is too expensive. Back before our database was tuned and we resolved a bunch of network issues I would have agreed, but we're almost guaranteed to have at least one call to the database on every page load right now and the site is fine. (Oracle 9i running on Solaris.) Does anybody have any good statistical and/or anecdotal evidence on whether Sesssion is better or worse than Client variables, specifically in CFMX6.1? ___ Do you Yahoo!? Express yourself with Y! Messenger! Free. Download now. http://messenger.yahoo.com [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: SESSION vs. CLIENT
The short answer is that there can be need for both depending on the situation. With CFMX Enterprise, you can leverage J2EE Sessions, that will allow you to duplicate sessions across a cluster. Sessions have the advantage of being able to store complex data types, and don't involve a call to a database. However, I've seen CF apps with client variables in a database in a clustered non-sticky environment work well. I would lean towards the J2EE duplicating sessions as a solutionpersonally. You can read more about it at www.bpurcell.org. - Calvin -Original Message- From:Al Everett Date:9/29/04 9:51 am To:CF-Talk Subj:SESSION vs. CLIENT We're working in a clustered environment (eight servers in one pool, two in several others) on Windows 2000/IIS 5.0 behind a BigIP load balancer with some CF5 and some CFMX. (Very soon to go all CFMX.) We use Session variables extensively to keep track of user's logon information, which has required us to use stick sessions on the load balancer to keep users stuck to a server. However, we've gone through several exercises with certain customers because of the way their proxy servers/firewall block or trap cookies or other issues. I have suggested that if we were to go to Client variables in a database for that information we would remove the need for sticky sessions. The argument against me has always been that a database transaction is too expensive. Back before our database was tuned and we resolved a bunch of network issues I would have agreed, but we're almost guaranteed to have at least one call to the database on every page load right now and the site is fine. (Oracle 9i running on Solaris.) Does anybody have any good statistical and/or anecdotal evidence on whether Sesssion is better or worse than Client variables, specifically in CFMX6.1? ___ Do you Yahoo!? Express yourself with Y! Messenger! Free. Download now. http://messenger.yahoo.com [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: SESSION vs. CLIENT
Calvin, He's using a BigIP hardware load balancer, so there's a good chance that he can outrun the J2EE session replication mechanism between requests.This isn't talked about a lot, but it happens. Using Client variables stored in either cookies or a database shared by the clustered servers eliminates potential undefined in Session scope errors because ColdFusion either receives all Client variables in the request (cookie) or ColdFusion waits until retrieval and parsing of the Client variable has happened (database). Note: before choosing to store Client variables in cookies (seductive because it is the fastest technique by far), make sure you're not storing any secure data in the Client scope.You wouldn't believe how many developers forget this; you can spoof cookies that will take you right into their admin sections.Also make sure the total size of your Client scope won't bust any cookie size or quantity limitations. Respectfully, Adam Phillip Churvis Member of Team Macromedia Advanced Intensive Training: * C# ASP.NET for ColdFusion Developers * ColdFusion MX Master Class * Advanced Development with CFMX and SQL Server 2000 http://www.ColdFusionTraining.com Download CommerceBlocks V2.1 and LoRCAT from http://www.ProductivityEnhancement.com The ColdFusion MX Bible is in bookstores now! - Original Message - From: Calvin Ward [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Wednesday, September 29, 2004 9:59 AM Subject: RE: SESSION vs. CLIENT The short answer is that there can be need for both depending on the situation. With CFMX Enterprise, you can leverage J2EE Sessions, that will allow you to duplicate sessions across a cluster. Sessions have the advantage of being able to store complex data types, and don't involve a call to a database. However, I've seen CF apps with client variables in a database in a clustered non-sticky environment work well. I would lean towards the J2EE duplicating sessions as a solution personally. You can read more about it at www.bpurcell.org. - Calvin -Original Message- From:Al Everett Date:9/29/04 9:51 am To:CF-Talk Subj:SESSION vs. CLIENT We're working in a clustered environment (eight servers in one pool, two in several others) on Windows 2000/IIS 5.0 behind a BigIP load balancer with some CF5 and some CFMX. (Very soon to go all CFMX.) We use Session variables extensively to keep track of user's logon information, which has required us to use stick sessions on the load balancer to keep users stuck to a server. However, we've gone through several exercises with certain customers because of the way their proxy servers/firewall block or trap cookies or other issues. I have suggested that if we were to go to Client variables in a database for that information we would remove the need for sticky sessions. The argument against me has always been that a database transaction is too expensive. Back before our database was tuned and we resolved a bunch of network issues I would have agreed, but we're almost guaranteed to have at least one call to the database on every page load right now and the site is fine. (Oracle 9i running on Solaris.) Does anybody have any good statistical and/or anecdotal evidence on whether Sesssion is better or worse than Client variables, specifically in CFMX6.1? ___ Do you Yahoo!? Express yourself with Y! Messenger! Free. Download now. http://messenger.yahoo.com [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: Session vs. Client Management
Phil has led you astray a little here and I will correct him. That's why I said it was from memory and I may be wrong g [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Session vs. Client Management
By default, this is incorrect. The CFID and CFTOKEN cookies are persistent, and have a ridiculously long time until they expire. If you want the connection to the session to be destroyed when the browser is closed, you need to write the cookies yourself without specifying an expiration value in your CFCOOKIE tags, or use the J2EE session option available in CFMX. I'm not sure of this, because if you close all browsers, then the cookies are lost I know that if you Ctrl+N/File, New or Open Link In New Window, then it copies the cookies over to the new browser, but opening a brand new browser (from the Start Menu (or Shortcut) then they don't exist [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Session vs. Client Management
By default, this is incorrect. The CFID and CFTOKEN cookies are persistent, and have a ridiculously long time until they expire. If you want the connection to the session to be destroyed when the browser is closed, you need to write the cookies yourself without specifying an expiration value in your CFCOOKIE tags, or use the J2EE session option available in CFMX. I'm not sure of this, because if you close all browsers, then the cookies are lost They're not on any of the machines in my classroom right now. I can close and reopen browsers all day long, and the cookies are still there. We did this as a student exercise yesterday, to demonstrate the difference between CFID/CFTOKEN and J2EE session management. I know that if you Ctrl+N/File, New or Open Link In New Window, then it copies the cookies over to the new browser, but opening a brand new browser (from the Start Menu (or Shortcut) then they don't exist If the cookies persisted from a previous session, I think they'll be available for all browser instances whether you open a brand new browser instance or not. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ phone: 202-797-5496 fax: 202-797-5444 [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Session vs. Client Management
It must tie it to the SessionTimeout in the CFAdmin and CFAPPLICATION then Maybe some testing is required g -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED] Sent: 28 January 2004 12:14 To: CF-Talk Subject: RE: Session vs. Client Management By default, this is incorrect. The CFID and CFTOKEN cookies are persistent, and have a ridiculously long time until they expire. If you want the connection to the session to be destroyed when the browser is closed, you need to write the cookies yourself without specifying an expiration value in your CFCOOKIE tags, or use the J2EE session option available in CFMX. I'm not sure of this, because if you close all browsers, then the cookies are lost They're not on any of the machines in my classroom right now. I can close and reopen browsers all day long, and the cookies are still there. We did this as a student exercise yesterday, to demonstrate the difference between CFID/CFTOKEN and J2EE session management. I know that if you Ctrl+N/File, New or Open Link In New Window, then it copies the cookies over to the new browser, but opening a brand new browser (from the Start Menu (or Shortcut) then they don't exist If the cookies persisted from a previous session, I think they'll be available for all browser instances whether you open a brand new browser instance or not. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ phone: 202-797-5496 fax: 202-797-5444 [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Session vs. Client Management
It must tie it to the SessionTimeout in the CFAdmin and CFAPPLICATION then If by it you mean the duration of the cookies, no, by default they last a very long time. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ phone: 202-797-5496 fax: 202-797-5444 [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Milestone (was RE: Session vs. Client Management)
I have been archiving Dave's posts since 11/18/1999.This is number 5,000. Cary Gordon The Cherry Hill Company At 12:54 PM 1/28/2004 -0500, you wrote: It must tie it to the SessionTimeout in the CFAdmin and CFAPPLICATION then If by it you mean the duration of the cookies, no, by default they last a very long time. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/http://www.figleaf.com/ phone: 202-797-5496 fax: 202-797-5444 [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Session vs. Client Management
That's ok just saying that you had mislead nothing meant by it:-) Regards Andrew Scott Technical Consultant NuSphere Pty Ltd Level 2/33 Bank Street South Melbourne, Victoria, 3205 Phone: 03 9686 0485-Fax: 03 9699 7976 _ From: Philip Arnold [mailto:[EMAIL PROTECTED] Sent: Wednesday, 28 January 2004 11:41 PM To: CF-Talk Subject: RE: Session vs. Client Management Phil has led you astray a little here and I will correct him. That's why I said it was from memory and I may be wrong g _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Session vs. Client Management
Actually that is not true Phil, I made a statement about this a few weeks ago. Under Internet Explorer, the cookies are not copied across. Internet explorer uses instances of windows and shares the data/settings of the windows control panel-Internet Options. Anytime you open a new browser either by ctrl-n or from the start menu it will use these settings. I think this change from V4.0 of internet explorer, to cut down on the amount of memory used by the program. Cookies will only expire like Dave Watts said, you expire them. Try it for yourself, write a small app that puts the cfid cftoken to the screen nothing more nothing less. Then try opening a new window via both methods and you will see the cfid cftoken DO NOT change. If they do then cookies are not enabled on your machine, simple as that. Regards Andrew Scott Technical Consultant NuSphere Pty Ltd Level 2/33 Bank Street South Melbourne, Victoria, 3205 Phone: 03 9686 0485-Fax: 03 9699 7976 _ From: Philip Arnold [mailto:[EMAIL PROTECTED] Sent: Thursday, 29 January 2004 1:41 AM To: CF-Talk Subject: RE: Session vs. Client Management By default, this is incorrect. The CFID and CFTOKEN cookies are persistent, and have a ridiculously long time until they expire. If you want the connection to the session to be destroyed when the browser is closed, you need to write the cookies yourself without specifying an expiration value in your CFCOOKIE tags, or use the J2EE session option available in CFMX. I'm not sure of this, because if you close all browsers, then the cookies are lost I know that if you Ctrl+N/File, New or Open Link In New Window, then it copies the cookies over to the new browser, but opening a brand new browser (from the Start Menu (or Shortcut) then they don't exist _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Session vs. Client Management
Actually that is not true Phil, I made a statement about this a few weeks ago. Under Internet Explorer, the cookies are not copied across. Internet explorer uses instances of windows and shares the data/settings of the windows control panel-Internet Options. Anytime you open a new browser either by ctrl-n or from the start menu it will use these settings. I think this change from V4.0 of internet explorer, to cut down on the amount of memory used by the program. Cookies will only expire like Dave Watts said, you expire them. Try it for yourself, write a small app that puts the cfid cftoken to the screen nothing more nothing less. Then try opening a new window via both methods and you will see the cfid cftoken DO NOT change. If they do then cookies are not enabled on your machine, simple as that. The funny thing about this is, we don't use Session management that often, so I'm used to using Client variables If I open a browser, create some client variables - then Ctrl+N a new window, the client variables are copied across, or shared Now, if I open a brand new browser (from the start menu), it doesn't have the client vars in it [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Session vs. Client Management
client and session vars are all session controlled by CFID CFToken, the same thing applies. I use client and never use session vars, and I think you may find that your cookies are not enabled and that is why you can getwhat your getting. Do you have a firewall in place, like Norton Internet Security or something else that is turning your cookies off. Regards Andrew Scott Technical Consultant NuSphere Pty Ltd Level 2/33 Bank Street South Melbourne, Victoria, 3205 Phone: 03 9686 0485-Fax: 03 9699 7976 _ From: Philip Arnold [mailto:[EMAIL PROTECTED] Sent: Thursday, 29 January 2004 12:35 PM To: CF-Talk Subject: RE: Session vs. Client Management The funny thing about this is, we don't use Session management that often, so I'm used to using Client variables If I open a browser, create some client variables - then Ctrl+N a new window, the client variables are copied across, or shared Now, if I open a brand new browser (from the start menu), it doesn't have the client vars in it _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Session vs. Client Management
Been using CF for so long, I should know these things without thinking.I'm guessing I may even have known the answers at one time... If a cfapplication has session, but not client management enabled (and is using client cookies), then is there any difference in the cookie that CF uses?Expiration date, for instance. How does CF keep track of sessions?I realize it uses the CFID/CFTOKEN combo set in a cookie or in the url, but where does it keep session tracking information and session variables?In memory?All sessions are lost if the cf application service is restarted, correct? If client management is enabled, does CF _ever_ clean up client variables or are they considered permanent? If client management is enabled, is there a simple way, for testing purposes, to reset the client variables so that a developer can test an application as if they were coming in fresh to the application? [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Session vs. Client Management
This is from memroy, so some of it might be a little off If a cfapplication has session, but not client management enabled (and is using client cookies), then is there any difference in the cookie that CF uses?Expiration date, for instance. The CFID and CFTOKEN variables are ALWAYS on the session level, so as soon as you close the browser, they go How does CF keep track of sessions?I realize it uses the CFID/CFTOKEN combo set in a cookie or in the url, but where does it keep session tracking information and session variables?In memory?All sessions are lost if the cf application service is restarted, correct? It's done with the CFID and CFTOKEN variables - when a new session is started (new browser window), it creates new ones for you From the documentation: Data is stored in memory so it is accessed quickly Data is lost when the client browser is inactive for a time-out period. You specify the time-out in the ColdFusion MX Administrator and Application.cfm. If client management is enabled, does CF _ever_ clean up client variables or are they considered permanent? In the Admin: Purge data for clients that remain unvisited for [] days If client management is enabled, is there a simple way, for testing purposes, to reset the client variables so that a developer can test an application as if they were coming in fresh to the application? There's a function DeleteClientVariable() HTH [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: Session vs. Client Management
- Original Message - From: Philip Arnold [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 7:46 PM Subject: RE: Session vs. Client Management This is from memroy, so some of it might be a little off If a cfapplication has session, but not client management enabled (and is using client cookies), then is there any difference in the cookie that CF uses?Expiration date, for instance. The CFID and CFTOKEN variables are ALWAYS on the session level, so as soon as you close the browser, they go Assume you're setting client cookies (which is necessary, if I'm not mistaken, to track the session without explicitly passing around the CFID/CFTOKEN url tokens). The bit of experimenting I've done today suggests that closing the browser does not end the session.It's picked up once again from the CFID/CFTOKEN in the cookie as long as the session hasn't timed out on the server. How does CF keep track of sessions?I realize it uses the CFID/CFTOKEN combo set in a cookie or in the url, but where does it keep session tracking information and session variables?In memory?All sessions are lost if the cf application service is restarted, correct? It's done with the CFID and CFTOKEN variables - when a new session is started (new browser window), it creates new ones for you From the documentation: Data is stored in memory so it is accessed quickly Data is lost when the client browser is inactive for a time-out period. You specify the time-out in the ColdFusion MX Administrator and Application.cfm. It appears that a new session will be started, but since the cookie exists on the client end, the session will have the same CFID/CFTOKEN.This is why I asked if session-only (if there is such a thing) cookies would have a expiration vs. the cookies used when client-management is enabled.For an application only using session management, it doesn't really affect behavior one way or the other, though.I was just wondering. If client management is enabled, does CF _ever_ clean up client variables or are they considered permanent? In the Admin: Purge data for clients that remain unvisited for [] days I'm running CF5 and don't see this in the Admin.Was that included in this version? If client management is enabled, is there a simple way, for testing purposes, to reset the client variables so that a developer can test an application as if they were coming in fresh to the application? There's a function DeleteClientVariable() Ok, I can get rid of client variables in the client variable store, but I'd really like to completely destroy the client cookies and force CF to see the client with a completely new CFID/CFTOKEN. Thanks. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Session vs. Client Management
Jim, Phil has led you astray a little here and I will correct him. CFID CFToken are used to identify which variables belong to that client, which is held in memory and controlled by the cookie. If the cookie has expiration then closing the browser will assign new values for CFID CFToken. Otherwise the next time they log in the cookie will keep these available until this cookie does expire. There is no difference in the cookie that CF uses for client or session, CFID CFToken are references for that client. Change them and they get reset to nothing, but are still held in the system until manually deleted or they expire by the server settings. Client variables are supposed to be cleaned up by CF, however I am yet to see CF clean the client variables up when stored in a DB. I don't use the registry forclient variables so I can't say if they do clean up or not. But there is a setting in the Administrator to change the length of time before deleting this. Regards Andrew Scott Technical Consultant NuSphere Pty Ltd Level 2/33 Bank Street South Melbourne, Victoria, 3205 Phone: 03 9686 0485-Fax: 03 9699 7976 _ From: Jim McAtee [mailto:[EMAIL PROTECTED] Sent: Wednesday, 28 January 2004 12:43 PM To: CF-Talk Subject: Session vs. Client Management Been using CF for so long, I should know these things without thinking.I'm guessing I may even have known the answers at one time... If a cfapplication has session, but not client management enabled (and is using client cookies), then is there any difference in the cookie that CF uses?Expiration date, for instance. How does CF keep track of sessions?I realize it uses the CFID/CFTOKEN combo set in a cookie or in the url, but where does it keep session tracking information and session variables?In memory?All sessions are lost if the cf application service is restarted, correct? If client management is enabled, does CF _ever_ clean up client variables or are they considered permanent? If client management is enabled, is there a simple way, for testing purposes, to reset the client variables so that a developer can test an application as if they were coming in fresh to the application? _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Session vs. Client Management
Jim, The purge clients that remain unvisited has been around in Coldfusion since 4.0 that I can recall. I can't recall the earlier versions as my memory can't go past 1998 on this fact Regards Andrew Scott Technical Consultant NuSphere Pty Ltd Level 2/33 Bank Street South Melbourne, Victoria, 3205 Phone: 03 9686 0485-Fax: 03 9699 7976 [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Session vs. Client Management
The CFID and CFTOKEN variables are ALWAYS on the session level, so as soon as you close the browser, they go By default, this is incorrect. The CFID and CFTOKEN cookies are persistent, and have a ridiculously long time until they expire. If you want the connection to the session to be destroyed when the browser is closed, you need to write the cookies yourself without specifying an expiration value in your CFCOOKIE tags, or use the J2EE session option available in CFMX. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ phone: 202-797-5496 fax: 202-797-5444 [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: Session vs. Client
Sandy Clark and Michael Smith wrote an article about how to avoid locking in your code by the automatic conversion of client and session scopes to request scope. http://www.cfug-md.org/Articles/RequestVariables.cfm CF_REQUEST is a custom tag that converts Session or Client scoped variables to Request scope. Hope this helps, DougF Original Message - From: Everett, Al [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Thursday, November 21, 2002 10:10 AM Subject: Resend: Session vs. Client | I know the obvious issue with going from SESSION to CLIENT variables (no | complex data type in CLIENT) but is there anything else I should be aware | of? Does anyone have a write-up of methods they've used? For instance, which | is better: converting out current structures stored in SESSION to WDDX | packets stored in CLIENT, or using simple ID fields in CLIENT and running | queries in Application.cfm and putting those queries in the REQUEST scope? ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm
RE: Session vs. Client
Btw, I am also working on converting CF_Request to a CFC for MX. Sandy Clark -Original Message- From: Doug Fentiman [mailto:[EMAIL PROTECTED]] Sent: Friday, November 22, 2002 5:36 PM To: CF-Talk Subject: Re: Session vs. Client Sandy Clark and Michael Smith wrote an article about how to avoid locking in your code by the automatic conversion of client and session scopes to request scope. http://www.cfug-md.org/Articles/RequestVariables.cfm CF_REQUEST is a custom tag that converts Session or Client scoped variables to Request scope. Hope this helps, DougF Original Message - From: Everett, Al [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Thursday, November 21, 2002 10:10 AM Subject: Resend: Session vs. Client | I know the obvious issue with going from SESSION to CLIENT variables (no | complex data type in CLIENT) but is there anything else I should be aware | of? Does anyone have a write-up of methods they've used? For instance, which | is better: converting out current structures stored in SESSION to WDDX | packets stored in CLIENT, or using simple ID fields in CLIENT and running | queries in Application.cfm and putting those queries in the REQUEST scope? ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting.
Resend: Session vs. Client
This apparently didn't make it out to the list yesterday: I've been asked to write up a document to detail what is involved in turning our session-dependent site into one that uses client variables instead. (The latest issue with the load balancer not maintaining session state on a server apparently was the proverbial straw.) I know the obvious issue with going from SESSION to CLIENT variables (no complex data type in CLIENT) but is there anything else I should be aware of? Does anyone have a write-up of methods they've used? For instance, which is better: converting out current structures stored in SESSION to WDDX packets stored in CLIENT, or using simple ID fields in CLIENT and running queries in Application.cfm and putting those queries in the REQUEST scope? Additionally, it appears that my top-level manager is convinced that storing CLIENT variables in a database will be too slow and would rather struggle with the load-balancer than try to change the app. Any ammunition I can use? Hints and tips would be appreciated. ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm
Session vs. Client
I've been asked to write up a document to detail what is involved in turning our session-dependent site into one that uses client variables instead. (The latest issue with the load balancer not maintaining session state on a server apparently was the proverbial straw.) I know the obvious issue with going from SESSION to CLIENT variables (no complex data type in CLIENT) but is there anything else I should be aware of? Does anyone have a write-up of methods they've used? For instance, which is better: converting out current structures stored in SESSION to WDDX packets stored in CLIENT, or using simple ID fields in CLIENT and running queries in Application.cfm and putting those queries in the REQUEST scope? Hints and tips would be appreciated. ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting.
Session VS Client
OK guys and gals.. Do Client vars take up more server RAM than session Vars. My colleague reckons they do wheras I reckon it's the t'other way round A -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Session VS Client
I suppose that depends on what you are putting in them ;) ~Simon Simon Horwith Macromedia Certified Instructor Certified ColdFusion Developer Fig Leaf Software 1400 16th St NW, # 500 Washington DC 20036 202.797.6570 (direct line) www.figleaf.com -Original Message- From: Andy Ewings [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 11:55 AM To: CF-Talk Subject: Session VS Client OK guys and gals.. Do Client vars take up more server RAM than session Vars. My colleague reckons they do wheras I reckon it's the t'other way round A -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Session VS Client
I recon you're correct! Session vars are stored in memory, Client vars are stored in any number of different locations (registry, client cookies, ODBC datasource). Jeff Garza Web Developer/Webmaster Spectrum Astro, Inc. 480.892.8200 [EMAIL PROTECTED] http://www.spectrumastro.com -Original Message- From: Andy Ewings [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 8:55 AM To: CF-Talk Subject: Session VS Client OK guys and gals.. Do Client vars take up more server RAM than session Vars. My colleague reckons they do wheras I reckon it's the t'other way round A -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Session VS Client
hi the general opinion is that client vars are more efficient than session variable, as long as the administrator is configured to store client variables in a database, otherwise it stores client variables in the registry which is less efficient that using session vars. so in a way you're both right :) -Original Message- From: Andy Ewings [mailto:[EMAIL PROTECTED]] Sent: 23 April 2001 16:55 To: CF-Talk Subject: Session VS Client OK guys and gals.. Do Client vars take up more server RAM than session Vars. My colleague reckons they do wheras I reckon it's the t'other way round A -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Session VS Client
Wouldn't haver thought it makes a difference. You either have to put them in a db or the registrywhich is a db in itself! -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. -Original Message- From: Simon Horwith [mailto:[EMAIL PROTECTED]] Sent: 23 April 2001 17:05 To: CF-Talk Subject: RE: Session VS Client I suppose that depends on what you are putting in them ;) ~Simon Simon Horwith Macromedia Certified Instructor Certified ColdFusion Developer Fig Leaf Software 1400 16th St NW, # 500 Washington DC 20036 202.797.6570 (direct line) www.figleaf.com -Original Message- From: Andy Ewings [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 11:55 AM To: CF-Talk Subject: Session VS Client OK guys and gals.. Do Client vars take up more server RAM than session Vars. My colleague reckons they do wheras I reckon it's the t'other way round A -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Session VS Client
personally, i think the registry is a less-than-desirable place to store client vars. the problem with session vars is if CF server restarts itself (which can, sometimes, be a good thing) you lose the session. i use client vars exclusively over session vars now (and cookies too) and store them in a DB. not as fast as memory in *theory*, but in practice it's more reliable and there's no difference in the performance of my applications. -Original Message- From: Garza, Jeff [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 9:04 AM To: CF-Talk Subject: RE: Session VS Client I recon you're correct! Session vars are stored in memory, Client vars are stored in any number of different locations (registry, client cookies, ODBC datasource). Jeff Garza Web Developer/Webmaster Spectrum Astro, Inc. 480.892.8200 [EMAIL PROTECTED] http://www.spectrumastro.com -Original Message- From: Andy Ewings [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 8:55 AM To: CF-Talk Subject: Session VS Client OK guys and gals.. Do Client vars take up more server RAM than session Vars. My colleague reckons they do wheras I reckon it's the t'other way round A -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Session VS Client
i don't think I'd classify the windows registry as a database. Yes, it stores data, but so do text files...I wouldn't refer to a text file as a database. The registry isn't designed to be read from and written to, frequently... it's designed for access - as - needed use. ~Simon Simon Horwith Macromedia Certified Instructor Certified ColdFusion Developer Fig Leaf Software 1400 16th St NW, # 500 Washington DC 20036 202.797.6570 (direct line) www.figleaf.com -Original Message- From: Andy Ewings [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 12:11 PM To: CF-Talk Subject: RE: Session VS Client Wouldn't haver thought it makes a difference. You either have to put them in a db or the registrywhich is a db in itself! -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. -Original Message- From: Simon Horwith [mailto:[EMAIL PROTECTED]] Sent: 23 April 2001 17:05 To: CF-Talk Subject: RE: Session VS Client I suppose that depends on what you are putting in them ;) ~Simon Simon Horwith Macromedia Certified Instructor Certified ColdFusion Developer Fig Leaf Software 1400 16th St NW, # 500 Washington DC 20036 202.797.6570 (direct line) www.figleaf.com -Original Message- From: Andy Ewings [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 11:55 AM To: CF-Talk Subject: Session VS Client OK guys and gals.. Do Client vars take up more server RAM than session Vars. My colleague reckons they do wheras I reckon it's the t'other way round A -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Session VS Client
the general opinion is that client vars are more efficient than session variable, as long as the administrator is configured to store client variables in a database, otherwise it stores client variables in the registry which is less efficient that using session vars. Either you've got the general opinion wrong, or the general opinion is itself wrong (or at least oversimplified). All other things being equal, it's more efficient to store something that will be reused in memory than it is to retrieve it from a database each time it's needed. When you use session variables, you're storing something in the local memory of the CF server. When you use client variables, CF has to continually go get them whenever they're needed, if they're stored in a database or in the registry. Client variables are probably a better choice if you think you're going to cluster your application on multiple servers, but on a single server, session variables will perform much better, assuming that there's enough memory to hold them. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Session VS Client
the registry is *not* designed to be a database in that sense. -Original Message- From: Andy Ewings [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 9:11 AM To: CF-Talk Subject: RE: Session VS Client Wouldn't haver thought it makes a difference. You either have to put them in a db or the registrywhich is a db in itself! -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. -Original Message- From: Simon Horwith [mailto:[EMAIL PROTECTED]] Sent: 23 April 2001 17:05 To: CF-Talk Subject: RE: Session VS Client I suppose that depends on what you are putting in them ;) ~Simon Simon Horwith Macromedia Certified Instructor Certified ColdFusion Developer Fig Leaf Software 1400 16th St NW, # 500 Washington DC 20036 202.797.6570 (direct line) www.figleaf.com -Original Message- From: Andy Ewings [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 11:55 AM To: CF-Talk Subject: Session VS Client OK guys and gals.. Do Client vars take up more server RAM than session Vars. My colleague reckons they do wheras I reckon it's the t'other way round A -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Session VS Client
Can you explain why storing Client vars in the registry is less efficient thatn storing session vars in RAM? -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. -Original Message- From: Mark Smyth [mailto:[EMAIL PROTECTED]] Sent: 23 April 2001 17:12 To: CF-Talk Subject: RE: Session VS Client hi the general opinion is that client vars are more efficient than session variable, as long as the administrator is configured to store client variables in a database, otherwise it stores client variables in the registry which is less efficient that using session vars. so in a way you're both right :) -Original Message- From: Andy Ewings [mailto:[EMAIL PROTECTED]] Sent: 23 April 2001 16:55 To: CF-Talk Subject: Session VS Client OK guys and gals.. Do Client vars take up more server RAM than session Vars. My colleague reckons they do wheras I reckon it's the t'other way round A -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Session VS Client
I agree entirely and I use Client for exactly the same reason. It's just that I never thought that they were more thirsty than Session vars when it came to server ram, as my colleague suggests. -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. -Original Message- From: Dylan Bromby [mailto:[EMAIL PROTECTED]] Sent: 23 April 2001 17:20 To: CF-Talk Subject: RE: Session VS Client personally, i think the registry is a less-than-desirable place to store client vars. the problem with session vars is if CF server restarts itself (which can, sometimes, be a good thing) you lose the session. i use client vars exclusively over session vars now (and cookies too) and store them in a DB. not as fast as memory in *theory*, but in practice it's more reliable and there's no difference in the performance of my applications. -Original Message- From: Garza, Jeff [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 9:04 AM To: CF-Talk Subject: RE: Session VS Client I recon you're correct! Session vars are stored in memory, Client vars are stored in any number of different locations (registry, client cookies, ODBC datasource). Jeff Garza Web Developer/Webmaster Spectrum Astro, Inc. 480.892.8200 [EMAIL PROTECTED] http://www.spectrumastro.com -Original Message- From: Andy Ewings [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 8:55 AM To: CF-Talk Subject: Session VS Client OK guys and gals.. Do Client vars take up more server RAM than session Vars. My colleague reckons they do wheras I reckon it's the t'other way round A -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Session VS Client
I disagree. The registry has replaced .ini files. The registry is a perfect repositry to store data for your app like DSN'S etc as ini files used to. -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. -Original Message- From: Simon Horwith [mailto:[EMAIL PROTECTED]] Sent: 23 April 2001 17:30 To: CF-Talk Subject: RE: Session VS Client i don't think I'd classify the windows registry as a database. Yes, it stores data, but so do text files...I wouldn't refer to a text file as a database. The registry isn't designed to be read from and written to, frequently... it's designed for access - as - needed use. ~Simon Simon Horwith Macromedia Certified Instructor Certified ColdFusion Developer Fig Leaf Software 1400 16th St NW, # 500 Washington DC 20036 202.797.6570 (direct line) www.figleaf.com -Original Message- From: Andy Ewings [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 12:11 PM To: CF-Talk Subject: RE: Session VS Client Wouldn't haver thought it makes a difference. You either have to put them in a db or the registrywhich is a db in itself! -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. -Original Message- From: Simon Horwith [mailto:[EMAIL PROTECTED]] Sent: 23 April 2001 17:05 To: CF-Talk Subject: RE: Session VS Client I suppose that depends on what you are putting in them ;) ~Simon Simon Horwith Macromedia Certified Instructor Certified ColdFusion Developer Fig Leaf Software 1400 16th St NW, # 500 Washington DC 20036 202.797.6570 (direct line) www.figleaf.com -Original Message- From: Andy Ewings [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 11:55 AM To: CF-Talk Subject: Session VS Client OK guys and gals.. Do Client vars take up more server RAM than session Vars. My colleague reckons they do wheras I reckon it's the t'other way round A -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890
RE: Session VS Client
Client variables are probably a better choice if you think you're going to cluster your application on multiple servers, but on a single server, session variables will perform much better, assuming that there's enough emory to hold them. Yup agreebut I think you have answered my initial question - in that session vars are more intensive when it comes to Server RAM -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED]] Sent: 23 April 2001 17:31 To: CF-Talk Subject: RE: Session VS Client the general opinion is that client vars are more efficient than session variable, as long as the administrator is configured to store client variables in a database, otherwise it stores client variables in the registry which is less efficient that using session vars. Either you've got the general opinion wrong, or the general opinion is itself wrong (or at least oversimplified). All other things being equal, it's more efficient to store something that will be reused in memory than it is to retrieve it from a database each time it's needed. When you use session variables, you're storing something in the local memory of the CF server. When you use client variables, CF has to continually go get them whenever they're needed, if they're stored in a database or in the registry. Client variables are probably a better choice if you think you're going to cluster your application on multiple servers, but on a single server, session variables will perform much better, assuming that there's enough memory to hold them. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
re: session vs client
hi They appears to be differing opinions to this? I have heard many people recommend the use of client variables over session variables, regardless of whether they are hosted in a clustered envoironment. Are there specific times when session variables are better to use than client variables, and visa versa? I'm fairly new to coldfusion and this is a subject which confuses most new comers Regards Mark Mark Smyth Developer Systems Union eBusiness Solutions 01865 880800 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] www.systemsunion.com http://www.systemsunion.com/ ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Session VS Client
Client variables are stored in: The Registry (not recommended) A Datasource as cookies Therefore, they use 0 RAM, zilch, nada, nothing. Session variables are stored in RAM. Since any amount of RAM is bigger than no amount of RAM, I would say that session variables must take up more RAM. I'm sure we'll see hundreds of post to this affect. At 04:55 PM 04/23/2001 +0100, you wrote: OK guys and gals.. Do Client vars take up more server RAM than session Vars. My colleague reckons they do wheras I reckon it's the t'other way round A -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Session VS Client
Andy Ewings wrote: I disagree. The registry has replaced .ini files. The registry is a perfect repositry to store data for your app like DSN'S etc as ini files used to. The key word here is store. Yes it replaces .ini files but that doesn't mean that it is suited for multiple and frequent access of that data. -- Every cloud has its silver lining, and lightning kills hundreds of people each year who are trying to find it. email: [EMAIL PROTECTED] web: http://www.pixelgeek.com/ ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Session VS Client
I've written plenty of applications, many of which store a wddx packet in a client variable. Can you imagine how large the registry would become, and how quickly, if I were to write wddx packets to it. The registry is designed to store windows system settings, not data of this type. ~Simon Simon Horwith Macromedia Certified Instructor Certified ColdFusion Developer Fig Leaf Software 1400 16th St NW, # 500 Washington DC 20036 202.797.6570 (direct line) www.figleaf.com -Original Message- From: Andy Ewings [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 12:49 PM To: CF-Talk Subject: RE: Session VS Client I disagree. The registry has replaced .ini files. The registry is a perfect repositry to store data for your app like DSN'S etc as ini files used to. -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. -Original Message- From: Simon Horwith [mailto:[EMAIL PROTECTED]] Sent: 23 April 2001 17:30 To: CF-Talk Subject: RE: Session VS Client i don't think I'd classify the windows registry as a database. Yes, it stores data, but so do text files...I wouldn't refer to a text file as a database. The registry isn't designed to be read from and written to, frequently... it's designed for access - as - needed use. ~Simon Simon Horwith Macromedia Certified Instructor Certified ColdFusion Developer Fig Leaf Software 1400 16th St NW, # 500 Washington DC 20036 202.797.6570 (direct line) www.figleaf.com -Original Message- From: Andy Ewings [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 12:11 PM To: CF-Talk Subject: RE: Session VS Client Wouldn't haver thought it makes a difference. You either have to put them in a db or the registrywhich is a db in itself! -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. -Original Message- From: Simon Horwith [mailto:[EMAIL PROTECTED]] Sent: 23 April 2001 17:05 To: CF-Talk Subject: RE: Session VS Client I suppose that depends on what you are putting in them ;) ~Simon Simon Horwith Macromedia Certified Instructor Certified ColdFusion Developer Fig Leaf Software 1400 16th St NW, # 500 Washington DC 20036 202.797.6570 (direct line) www.figleaf.com -Original Message- From: Andy Ewings [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 11:55 AM To: CF-Talk Subject: Session VS Client OK guys and gals.. Do Client vars take up more server RAM than session Vars. My colleague reckons they do wheras I reckon it's the t'other way round A -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131
RE: session vs client
I agree, this seems to be a hazy area. I tend to use client vars even if it isn't a clustered environment. IMO I think that the only disadvantage of Client vars is you can't expire them as easy as you can with sesison vars, you have to go to the DB and clear the entry. However the fact that you can let the db handle locking by using client vars is a godsend!...I find it an absolute pain having to lock every time I read or write to a session var. From what Dave said earlier it seems that it is quicker to use Session Vars via server RAM rather than client vars via a db providing you have enough server RAM. I guess it's a trade off - the more session vars you need to store (no of session vars you declare * number of active sessions) then the more there is a case to move to client vars. Either that or upgrade your server ram! -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. -Original Message- From: Mark Smyth [mailto:[EMAIL PROTECTED]] Sent: 23 April 2001 17:57 To: CF-Talk Subject: re: session vs client hi They appears to be differing opinions to this? I have heard many people recommend the use of client variables over session variables, regardless of whether they are hosted in a clustered envoironment. Are there specific times when session variables are better to use than client variables, and visa versa? I'm fairly new to coldfusion and this is a subject which confuses most new comers Regards Mark Mark Smyth Developer Systems Union eBusiness Solutions 01865 880800 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] www.systemsunion.com http://www.systemsunion.com/ ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Session VS Client
Accessing RAM is quicker than accessing the hard drive. The registry is located on the hard drive. At 05:32 PM 04/23/2001 +0100, you wrote: Can you explain why storing Client vars in the registry is less efficient thatn storing session vars in RAM? -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. -Original Message- From: Mark Smyth [mailto:[EMAIL PROTECTED]] Sent: 23 April 2001 17:12 To: CF-Talk Subject: RE: Session VS Client hi the general opinion is that client vars are more efficient than session variable, as long as the administrator is configured to store client variables in a database, otherwise it stores client variables in the registry which is less efficient that using session vars. so in a way you're both right :) -Original Message- From: Andy Ewings [mailto:[EMAIL PROTECTED]] Sent: 23 April 2001 16:55 To: CF-Talk Subject: Session VS Client OK guys and gals.. Do Client vars take up more server RAM than session Vars. My colleague reckons they do wheras I reckon it's the t'other way round A -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Session VS Client
the problem with session vars is if CF server restarts itself (which can, sometimes, be a good thing) you lose the session. i use client vars exclusively over session vars now (and cookies too) and store them in a DB. not as fast as memory in *theory*, but in practice it's more reliable and there's no difference in the performance of my applications. Maybe there's no difference in the performance of your applications, but I've often seen the move from session to client variables (usually in preparation for clustering) slow down applications significantly. If you store enough data in the Session scope, it's not practical to just move that data to the Client scope, as you'll end up with quite long strings. Session variables are more robust, certainly (when stored in a database), but they're definitely quite a bit slower. This makes sense - otherwise, why would we bother caching queries and output to make applications faster, rather than just returning to the database for every data view? Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Session VS Client
I would classify DSNs as system data, not app data. I think what Simon was trying to get at was, the registry is not designed (or optimized) for RDBMS functionality. You do not want to use it to store excessive (or in my opinion, any) application data. At 05:48 PM 04/23/2001 +0100, you wrote: I disagree. The registry has replaced .ini files. The registry is a perfect repositry to store data for your app like DSN'S etc as ini files used to. -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. -Original Message- From: Simon Horwith [mailto:[EMAIL PROTECTED]] Sent: 23 April 2001 17:30 To: CF-Talk Subject: RE: Session VS Client i don't think I'd classify the windows registry as a database. Yes, it stores data, but so do text files...I wouldn't refer to a text file as a database. The registry isn't designed to be read from and written to, frequently... it's designed for access - as - needed use. ~Simon Simon Horwith Macromedia Certified Instructor Certified ColdFusion Developer Fig Leaf Software 1400 16th St NW, # 500 Washington DC 20036 202.797.6570 (direct line) www.figleaf.com -Original Message- From: Andy Ewings [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 12:11 PM To: CF-Talk Subject: RE: Session VS Client Wouldn't haver thought it makes a difference. You either have to put them in a db or the registrywhich is a db in itself! -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. -Original Message- From: Simon Horwith [mailto:[EMAIL PROTECTED]] Sent: 23 April 2001 17:05 To: CF-Talk Subject: RE: Session VS Client I suppose that depends on what you are putting in them ;) ~Simon Simon Horwith Macromedia Certified Instructor Certified ColdFusion Developer Fig Leaf Software 1400 16th St NW, # 500 Washington DC 20036 202.797.6570 (direct line) www.figleaf.com -Original Message- From: Andy Ewings [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 11:55 AM To: CF-Talk Subject: Session VS Client OK guys and gals.. Do Client vars take up more server RAM than session Vars. My colleague reckons they do wheras I reckon it's the t'other way round A -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other
RE: Session VS Client
Wouldn't haver thought it makes a difference. You either have to put them in a db or the registrywhich is a db in itself! Calling the registry a database is technically accurate in the same way that you might call an LDAP server a database, but it's conversationally inaccurate. Typically, when people say database, they're thinking relational database, which the registry isn't. You sure don't want to treat the registry as a database. It's a hierarchical data store, designed for frequent reads and infrequent writes. When used with CF Client variables, you end up with very frequent writes, causing the registry to grow (sometimes making the machine crash). Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Session VS Client
Can you explain why storing Client vars in the registry is less efficient than storing session vars in RAM? Storing Client variables in anything but cookies is less efficient than storing session variables in RAM. It's simply faster to get something out of the memory owned by a process than it is to read a file or query a database. That's why you cache things in memory. Keep in mind that efficiency and robustness are often antagonistic goals. Increasing performance often involves losing stability. Storing Client variables in the registry, however, is neither efficient nor robust. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Session VS Client
actually, I believe the cfid and cftoken are stored in memory, even with client variables. ~Simon Simon Horwith Macromedia Certified Instructor Certified ColdFusion Developer Fig Leaf Software 1400 16th St NW, # 500 Washington DC 20036 202.797.6570 (direct line) www.figleaf.com -Original Message- From: Jeffry Houser [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 4:09 PM To: CF-Talk Subject: Re: Session VS Client Client variables are stored in: The Registry (not recommended) A Datasource as cookies Therefore, they use 0 RAM, zilch, nada, nothing. Session variables are stored in RAM. Since any amount of RAM is bigger than no amount of RAM, I would say that session variables must take up more RAM. I'm sure we'll see hundreds of post to this affect. At 04:55 PM 04/23/2001 +0100, you wrote: OK guys and gals.. Do Client vars take up more server RAM than session Vars. My colleague reckons they do wheras I reckon it's the t'other way round A -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Session VS Client
Maybe there's no difference in the performance of your applications, but I've often seen the move from session to client variables (usually in preparation for clustering) slow down applications significantly. If you store enough data in the Session scope, it's not practical to just move that data to the Client scope, as you'll end up with quite long strings. For my applications in question, there was no difference. Session variables are more robust, certainly (when stored in a database), but they're definitely quite a bit slower. I didn't know session vars were stored in a DB, I thought they were only stored in memory. This makes sense - otherwise, why would we bother caching queries and output to make applications faster, rather than just returning to the database for every data view? Ok, I'm not debating whether *anything* should be stored in memory. My query caching works nicely. My *specific* problem was CF restarting itself and dropping session vars I was using to keep people logged into my application. I was using them to maintain state. I found that session vars were therefore unreliable so I switched to client vars. ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Session VS Client
My 2 cents worth (gawd it's been awhile since I've posted to this list) Client Variables: When set: Stored to Registry after briefly being held in RAM When got: Gotten from Registry and (briefly) stored to RAM before sent to user Anything before going to the Hard Drive would have at least a brief stay in RAM Session Variables: When set: Put in RAM When got: Retrieved from RAM You figure on this Gregory Harris Web Developer The Stirling Bridge Group, LLC *We Engineer Internet Business Solutions* TEL: (949) 707-1534 FAX: (949) 707-1535 - Original Message - From: Andy Ewings [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Monday, April 23, 2001 9:50 AM Subject: RE: Session VS Client Client variables are probably a better choice if you think you're going to cluster your application on multiple servers, but on a single server, session variables will perform much better, assuming that there's enough emory to hold them. Yup agreebut I think you have answered my initial question - in that session vars are more intensive when it comes to Server RAM -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED]] Sent: 23 April 2001 17:31 To: CF-Talk Subject: RE: Session VS Client the general opinion is that client vars are more efficient than session variable, as long as the administrator is configured to store client variables in a database, otherwise it stores client variables in the registry which is less efficient that using session vars. Either you've got the general opinion wrong, or the general opinion is itself wrong (or at least oversimplified). All other things being equal, it's more efficient to store something that will be reused in memory than it is to retrieve it from a database each time it's needed. When you use session variables, you're storing something in the local memory of the CF server. When you use client variables, CF has to continually go get them whenever they're needed, if they're stored in a database or in the registry. Client variables are probably a better choice if you think you're going to cluster your application on multiple servers, but on a single server, session variables will perform much better, assuming that there's enough memory to hold them. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Session VS Client
i have one table with 3.2 million rows that gets accessed approximately 6,000-7,000 times a day. i should put that in the registry? your comment VERY MUCH depends on the kind of app you're talking about. ok so IIS stores info there. ms office stores info there. but we're talking about web-based applications which could create LARGE amounts of data. why would you EVER purposefully tax your registry (which is used by many other VERY critical processes) with READ/WRITE/DELETE operations when databases are designed to handle that? -Original Message- From: Andy Ewings [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 9:49 AM To: CF-Talk Subject: RE: Session VS Client I disagree. The registry has replaced .ini files. The registry is a perfect repositry to store data for your app like DSN'S etc as ini files used to. -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. -Original Message- From: Simon Horwith [mailto:[EMAIL PROTECTED]] Sent: 23 April 2001 17:30 To: CF-Talk Subject: RE: Session VS Client i don't think I'd classify the windows registry as a database. Yes, it stores data, but so do text files...I wouldn't refer to a text file as a database. The registry isn't designed to be read from and written to, frequently... it's designed for access - as - needed use. ~Simon Simon Horwith Macromedia Certified Instructor Certified ColdFusion Developer Fig Leaf Software 1400 16th St NW, # 500 Washington DC 20036 202.797.6570 (direct line) www.figleaf.com -Original Message- From: Andy Ewings [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 12:11 PM To: CF-Talk Subject: RE: Session VS Client Wouldn't haver thought it makes a difference. You either have to put them in a db or the registrywhich is a db in itself! -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. -Original Message- From: Simon Horwith [mailto:[EMAIL PROTECTED]] Sent: 23 April 2001 17:05 To: CF-Talk Subject: RE: Session VS Client I suppose that depends on what you are putting in them ;) ~Simon Simon Horwith Macromedia Certified Instructor Certified ColdFusion Developer Fig Leaf Software 1400 16th St NW, # 500 Washington DC 20036 202.797.6570 (direct line) www.figleaf.com -Original Message- From: Andy Ewings [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 11:55 AM To: CF-Talk Subject: Session VS Client OK guys and gals.. Do Client vars take up more server RAM than session Vars. My colleague reckons they do wheras I reckon it's the t'other way round A -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131
RE: session vs client
We've been switching all of our applications from Session to Client variables even though most of our applications do not run in clustered environments. We've just had too many problems with the way in which ColdFusion handles data stored in shared resources such as memory. Although religious use of the CFLOCK tag eliminates most of these issues, we still experience the occasional Cannot Synchronize Object errors, or some equivalently obscure and inexplicable message. Repeated posts to lists and searches throughout the Web, Allaire Forums, and the Allaire Knowledge base always proved fruitless. Though client variables take more overhead (not memory but CPU, Network Traffic, Database Resources, etc.) and complex datatypes cannot be stored in a Client variable without first serializing the data into a WDDX structure, these are relatively minor concerns when compared to the inevitable server instability or just plain application unreliability brought about by Session variables. Of course, my opinion is a little biased. :) I've often been seen ranting on this list about problems with Session variables and the way ColdFusion threads handle access to data stored in shared resources. Unfortunately, it doesn't look like ColdFusion 5 will address any of these issues. So unless we hear different, we will continue to change all of our application from Session variables to Client variables. Benjamin S. Rogers Web Developer, c4.net Voice: (508) 240-0051 Fax: (508) 240-0057 -Original Message- From: Mark Smyth [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 12:57 PM To: CF-Talk Subject: re: session vs client hi They appears to be differing opinions to this? I have heard many people recommend the use of client variables over session variables, regardless of whether they are hosted in a clustered envoironment. Are there specific times when session variables are better to use than client variables, and visa versa? I'm fairly new to coldfusion and this is a subject which confuses most new comers Regards Mark Mark Smyth Developer Systems Union eBusiness Solutions 01865 880800 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] www.systemsunion.com http://www.systemsunion.com/ ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Session VS Client
I couldn't agree more. Did you know that if you have client variables turned on CF will generate two select statements for every single page hit? And, if you don't turn off global client variable updates (which are turned on by default), you also generate an INSERT/UPDATE statement for every page, even if you aren't accessing any client variables on that page. To me that's a whole lot of unnecessary database calls, which will seriously impede performance. As Dave points out, most people are aware of how important query caching is, but many of those same people use client variables, without a need for storing information from session to session or supporting a clustered environment, thereby creating a tremendous amount of database traffic. Bob -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED]] Sent: April 23, 2001 1:32 PM To: CF-Talk Subject: RE: Session VS Client the problem with session vars is if CF server restarts itself (which can, sometimes, be a good thing) you lose the session. i use client vars exclusively over session vars now (and cookies too) and store them in a DB. not as fast as memory in *theory*, but in practice it's more reliable and there's no difference in the performance of my applications. Maybe there's no difference in the performance of your applications, but I've often seen the move from session to client variables (usually in preparation for clustering) slow down applications significantly. If you store enough data in the Session scope, it's not practical to just move that data to the Client scope, as you'll end up with quite long strings. Session variables are more robust, certainly (when stored in a database), but they're definitely quite a bit slower. This makes sense - otherwise, why would we bother caching queries and output to make applications faster, rather than just returning to the database for every data view? Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Session VS Client
Session variables are more robust, certainly (when stored in a database), but they're definitely quite a bit slower. I didn't know session vars were stored in a DB, I thought they were only stored in memory. I think Dave slipped up here. :) Client variables are generally more robust and can be stored in the database. Session variables are generally faster as they are stored in RAM. Benjamin S. Rogers Web Developer, c4.net Voice: (508) 240-0051 Fax: (508) 240-0057 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Session VS Client
:hmm: I did not know that. Does anyone know for a fact? I thought CFID / CFTOKEN were typically stored as cookies? Although, I know the values are doubled in the session scope along with a few others. At 01:39 PM 04/23/2001 -0400, you wrote: actually, I believe the cfid and cftoken are stored in memory, even with client variables. ~Simon Simon Horwith Macromedia Certified Instructor Certified ColdFusion Developer Fig Leaf Software 1400 16th St NW, # 500 Washington DC 20036 202.797.6570 (direct line) www.figleaf.com -Original Message- From: Jeffry Houser [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 4:09 PM To: CF-Talk Subject: Re: Session VS Client Client variables are stored in: The Registry (not recommended) A Datasource as cookies Therefore, they use 0 RAM, zilch, nada, nothing. Session variables are stored in RAM. Since any amount of RAM is bigger than no amount of RAM, I would say that session variables must take up more RAM. I'm sure we'll see hundreds of post to this affect. At 04:55 PM 04/23/2001 +0100, you wrote: OK guys and gals.. Do Client vars take up more server RAM than session Vars. My colleague reckons they do wheras I reckon it's the t'other way round A -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Session VS Client
as i replied to dave, i use database caching and it's great. i use client vars to maintain state when users connect to certain applications because if CF restarts itself, it will kill any open session vars. if CF had a way of maintaining this better, i would love to store them in memory (sessions vs. client) since i have 1GB to use. ironically, it's CFPOP that causes CF to restart itself...don't even get me started on that :). -Original Message- From: Bob Silverberg [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 11:18 AM To: CF-Talk Subject: RE: Session VS Client I couldn't agree more. Did you know that if you have client variables turned on CF will generate two select statements for every single page hit? And, if you don't turn off global client variable updates (which are turned on by default), you also generate an INSERT/UPDATE statement for every page, even if you aren't accessing any client variables on that page. To me that's a whole lot of unnecessary database calls, which will seriously impede performance. As Dave points out, most people are aware of how important query caching is, but many of those same people use client variables, without a need for storing information from session to session or supporting a clustered environment, thereby creating a tremendous amount of database traffic. Bob -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED]] Sent: April 23, 2001 1:32 PM To: CF-Talk Subject: RE: Session VS Client the problem with session vars is if CF server restarts itself (which can, sometimes, be a good thing) you lose the session. i use client vars exclusively over session vars now (and cookies too) and store them in a DB. not as fast as memory in *theory*, but in practice it's more reliable and there's no difference in the performance of my applications. Maybe there's no difference in the performance of your applications, but I've often seen the move from session to client variables (usually in preparation for clustering) slow down applications significantly. If you store enough data in the Session scope, it's not practical to just move that data to the Client scope, as you'll end up with quite long strings. Session variables are more robust, certainly (when stored in a database), but they're definitely quite a bit slower. This makes sense - otherwise, why would we bother caching queries and output to make applications faster, rather than just returning to the database for every data view? Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Session VS Client
As Dave points out, most people are aware of how important query caching is, but many of those same people use client variables, without a need for storing information from session to session or supporting a clustered environment, thereby creating a tremendous amount of database traffic. Although I agree with this point, there are several other very valid reasons for using Session variables. Someone has already brought up the point that restarting the service doesn't necessarily cripple the user's session if the application is using client variables. In addition, on the user's side of things, Client variables generally act more like real session than do Session variables since Client variables are not arbitrarily expired every so many minutes. Of course, you can set Session variables to expire after a hours or days, but in most applications, that would take up an untenable amount or RAM: generally, your database server has more disk space than your Web server has RAM. And of course, my old sounding board is that even a very careful use of Session variables generally affects server stability in a manner that Client variables do not. I know many people will claim that they experience no problems with properly locked Session variables. Either we are cursed or we just read our log files more thoroughly, because we have seen all manner of intermittent errors and unusually application behavior stemming from Session variables. These slowly disappear as we phase out of developing and maintaining applications with Session variables in favor of Client variables. Benjamin S. Rogers Web Developer, c4.net Voice: (508) 240-0051 Fax: (508) 240-0057 Bob -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED]] Sent: April 23, 2001 1:32 PM To: CF-Talk Subject: RE: Session VS Client the problem with session vars is if CF server restarts itself (which can, sometimes, be a good thing) you lose the session. i use client vars exclusively over session vars now (and cookies too) and store them in a DB. not as fast as memory in *theory*, but in practice it's more reliable and there's no difference in the performance of my applications. Maybe there's no difference in the performance of your applications, but I've often seen the move from session to client variables (usually in preparation for clustering) slow down applications significantly. If you store enough data in the Session scope, it's not practical to just move that data to the Client scope, as you'll end up with quite long strings. Session variables are more robust, certainly (when stored in a database), but they're definitely quite a bit slower. This makes sense - otherwise, why would we bother caching queries and output to make applications faster, rather than just returning to the database for every data view? Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Session VS Client
:hmm: I did not know that. Does anyone know for a fact? I thought CFID / CFTOKEN were typically stored as cookies? Although, I know the values are doubled in the session scope along with a few others.\ Well, since they're used as a matching key, they have to be stored somewhere other than cookies. If you think about it, all Client variables must be stored in memory. They're just not persistent, so they're essentially destroyed and recreated for each page request just like local and Request variables. But to be able to use them, CF has to look them up, which pulls them into memory for the duration of the page request. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Session VS Client
Session variables are more robust, certainly (when stored in a database), but they're definitely quite a bit slower. I didn't know session vars were stored in a DB, I thought they were only stored in memory. You're right, of course. I'm a bit woozy today. Sorry about that. I meant that Client variables are more robust (which is, of course, why you're using them!). Ok, I'm not debating whether *anything* should be stored in memory. My query caching works nicely. My *specific* problem was CF restarting itself and dropping session vars I was using to keep people logged into my application. I was using them to maintain state. I found that session vars were therefore unreliable so I switched to client vars. And, of course, for your app you're doing the right thing. That's one of the problems with email lists. Very often, a discussion revolves around which is better, when it's often the case, as it is now, that neither is better. It completely depends on the needs and circumstances of your application. If you're having stability problems with memory variables, as you and many others are, you'd be a fool to use them because they're more efficient - who cares how efficient your app is if it's always crashing? I'd be the first to say that each has an appropriate place for use. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Session VS Client
If performance is paramount and assuming that enough memory is available and depending on how much client var data an app would create, why not create a memory-resident database and use it to store client vars? You would have to flush regularly to disk but it might help performance if that's most important. Oracle can pretty much do that anyway though right but could a poor man's work-around be to create a RAM Disk (if you can, I haven't seen this in a long time, can you do it on Win2k?) and copy the database data files to it. The only advantage of this over file-system caching would be that you are reserving RAM for that data and so it wouldn't be cleared out of cache. At a low OS level you could programmatically create memory-mapped files but that's would be a whole development effort in and of itself. Another .02 cents to the pile Kev -Original Message- From: Benjamin S. Rogers [mailto:[EMAIL PROTECTED]] Sent: Monday, April 23, 2001 3:36 PM To: CF-Talk Subject: RE: Session VS Client As Dave points out, most people are aware of how important query caching is, but many of those same people use client variables, without a need for storing information from session to session or supporting a clustered environment, thereby creating a tremendous amount of database traffic. Although I agree with this point, there are several other very valid reasons for using Session variables. Someone has already brought up the point that restarting the service doesn't necessarily cripple the user's session if the application is using client variables. In addition, on the user's side of things, Client variables generally act more like real session than do Session variables since Client variables are not arbitrarily expired every so many minutes. Of course, you can set Session variables to expire after a hours or days, but in most applications, that would take up an untenable amount or RAM: generally, your database server has more disk space than your Web server has RAM. And of course, my old sounding board is that even a very careful use of Session variables generally affects server stability in a manner that Client variables do not. I know many people will claim that they experience no problems with properly locked Session variables. Either we are cursed or we just read our log files more thoroughly, because we have seen all manner of intermittent errors and unusually application behavior stemming from Session variables. These slowly disappear as we phase out of developing and maintaining applications with Session variables in favor of Client variables. Benjamin S. Rogers Web Developer, c4.net Voice: (508) 240-0051 Fax: (508) 240-0057 Bob -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED]] Sent: April 23, 2001 1:32 PM To: CF-Talk Subject: RE: Session VS Client the problem with session vars is if CF server restarts itself (which can, sometimes, be a good thing) you lose the session. i use client vars exclusively over session vars now (and cookies too) and store them in a DB. not as fast as memory in *theory*, but in practice it's more reliable and there's no difference in the performance of my applications. Maybe there's no difference in the performance of your applications, but I've often seen the move from session to client variables (usually in preparation for clustering) slow down applications significantly. If you store enough data in the Session scope, it's not practical to just move that data to the Client scope, as you'll end up with quite long strings. Session variables are more robust, certainly (when stored in a database), but they're definitely quite a bit slower. This makes sense - otherwise, why would we bother caching queries and output to make applications faster, rather than just returning to the database for every data view? Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists