waynew Posted December 11, 2008 Share Posted December 11, 2008 Do you use server-side sessions, cookies, server-side sessions & cookies, or any of the aforementioned in correlation with a database? I was all into server-side sessions and cookies until I read that it is hard to scale up an application when it relies on server-side sessions. However, I'm not mad about db session handling either, as I'm very weary of causing additional overhead. What opinion/knowledge/experience/divine inspiration do you guys have on the subject? Quote Link to comment https://forums.phpfreaks.com/topic/136522-what-do-usually-go-for/ Share on other sites More sharing options...
zq29 Posted December 11, 2008 Share Posted December 11, 2008 I generally use the right tools for the right job... They're all useful in a number of different applications. Quote Link to comment https://forums.phpfreaks.com/topic/136522-what-do-usually-go-for/#findComment-712902 Share on other sites More sharing options...
corbin Posted December 11, 2008 Share Posted December 11, 2008 File based sessions usually don't work very well on a cluster, and in that situation, one of the few solutions is to use DB sessions. I guess any form of caching could be used really, where it all comes from one location. (In which case, files could actually be used if locking was right.) Quote Link to comment https://forums.phpfreaks.com/topic/136522-what-do-usually-go-for/#findComment-713130 Share on other sites More sharing options...
waynew Posted December 12, 2008 Author Share Posted December 12, 2008 I'm just very wary of DB Sessions. Would it not increase overhead by a significant amount? Quote Link to comment https://forums.phpfreaks.com/topic/136522-what-do-usually-go-for/#findComment-713563 Share on other sites More sharing options...
corbin Posted December 12, 2008 Share Posted December 12, 2008 Why? Everything scales differently. There are different advantages/disadvantages to everything. Let's say you have a cluster of 20 servers on a LAN with different access points. Are you going to use file based sessions? Have fun with file locking. Quote Link to comment https://forums.phpfreaks.com/topic/136522-what-do-usually-go-for/#findComment-714252 Share on other sites More sharing options...
Daniel0 Posted December 12, 2008 Share Posted December 12, 2008 I'm just very wary of DB Sessions. Would it not increase overhead by a significant amount? All sessions here are stored in the database. Quote Link to comment https://forums.phpfreaks.com/topic/136522-what-do-usually-go-for/#findComment-714286 Share on other sites More sharing options...
waynew Posted December 12, 2008 Author Share Posted December 12, 2008 Why? Everything scales differently. There are different advantages/disadvantages to everything. Let's say you have a cluster of 20 servers on a LAN with different access points. Are you going to use file based sessions? Have fun with file locking. Oh I understand that. If it wasn't for that fact, I wouldn't have brought the topic up. I'm just saying that it's pretty difficult to choose what kind of system to implement. You may be wanting to use DB Sessions in order to make your website more scalable, yet the fact that you're only starting a website off, in it's early stages, means that DB resources are probably going to be pretty minimum. All sessions here are stored in the database. Oh I knew that. But then again, PHPFreak's resources are far more powerful than somebody who is just launching a new website. Quote Link to comment https://forums.phpfreaks.com/topic/136522-what-do-usually-go-for/#findComment-714289 Share on other sites More sharing options...
akitchin Posted December 12, 2008 Share Posted December 12, 2008 Why? Everything scales differently. There are different advantages/disadvantages to everything. Let's say you have a cluster of 20 servers on a LAN with different access points. Are you going to use file based sessions? Have fun with file locking. Oh I understand that. If it wasn't for that fact, I wouldn't have brought the topic up. I'm just saying that it's pretty difficult to choose what kind of system to implement. You may be wanting to use DB Sessions in order to make your website more scalable, yet the fact that you're only starting a website off, in it's early stages, means that DB resources are probably going to be pretty minimum. All sessions here are stored in the database. Oh I knew that. But then again, PHPFreak's resources are far more powerful than somebody who is just launching a new website. you know and understand everything, don't you? Quote Link to comment https://forums.phpfreaks.com/topic/136522-what-do-usually-go-for/#findComment-714290 Share on other sites More sharing options...
Daniel0 Posted December 12, 2008 Share Posted December 12, 2008 All sessions here are stored in the database. Oh I knew that. But then again, PHPFreak's resources are far more powerful than somebody who is just launching a new website. Oh, yeah, but it's the forums too, so anyone running SMF will be storing session data in the table. We have more resources because we get more hits. A site with less hits will require less resources as well. Quote Link to comment https://forums.phpfreaks.com/topic/136522-what-do-usually-go-for/#findComment-714295 Share on other sites More sharing options...
waynew Posted December 12, 2008 Author Share Posted December 12, 2008 Why? Everything scales differently. There are different advantages/disadvantages to everything. Let's say you have a cluster of 20 servers on a LAN with different access points. Are you going to use file based sessions? Have fun with file locking. Oh I understand that. If it wasn't for that fact, I wouldn't have brought the topic up. I'm just saying that it's pretty difficult to choose what kind of system to implement. You may be wanting to use DB Sessions in order to make your website more scalable, yet the fact that you're only starting a website off, in it's early stages, means that DB resources are probably going to be pretty minimum. All sessions here are stored in the database. Oh I knew that. But then again, PHPFreak's resources are far more powerful than somebody who is just launching a new website. you know and understand everything, don't you? No? But I do know about/understand what they were talking about above. Hence the reason I started the topic? Quote Link to comment https://forums.phpfreaks.com/topic/136522-what-do-usually-go-for/#findComment-714296 Share on other sites More sharing options...
waynew Posted December 12, 2008 Author Share Posted December 12, 2008 All sessions here are stored in the database. Oh I knew that. But then again, PHPFreak's resources are far more powerful than somebody who is just launching a new website. Oh, yeah, but it's the forums too, so anyone running SMF will be storing session data in the table. We have more resources because we get more hits. A site with less hits will require less resources as well. That's what has got me pandering towards DB Sessions. But as I said, I was just a little weary. I'll be launching a site in the next month or so on a shared hosting plan, so it's things like these that really get me worrying. Use server side sessions and scalability will be a nightmare. Use DB Sessions and you're looking at extra overhead on a site that is completely dynamic. But, I suppose, DB Sessions aren't really a choice, they're more of a necessity if you're planning to upgrade without a hitch. Also, on a shared host, server-side sessions are far more risky. I think that I'll be pretty okay in terms of changing the system to use DB Sessions, as I use abstracted most of the session functionality on my site. Quote Link to comment https://forums.phpfreaks.com/topic/136522-what-do-usually-go-for/#findComment-714299 Share on other sites More sharing options...
Daniel0 Posted December 13, 2008 Share Posted December 13, 2008 It's pretty trivial to do using session_set_save_handler. Quote Link to comment https://forums.phpfreaks.com/topic/136522-what-do-usually-go-for/#findComment-714306 Share on other sites More sharing options...
corbin Posted December 13, 2008 Share Posted December 13, 2008 "Use server side sessions and scalability will be a nightmare." Server side sessions? Are there client side sessions??? New to me. The basic concept of a session is to load data on the server side based on a token provided by the client. Quote Link to comment https://forums.phpfreaks.com/topic/136522-what-do-usually-go-for/#findComment-714423 Share on other sites More sharing options...
waynew Posted December 13, 2008 Author Share Posted December 13, 2008 Use server side sessions and scalability will be a nightmare As in, session information that is stored on the server? Quote Link to comment https://forums.phpfreaks.com/topic/136522-what-do-usually-go-for/#findComment-714512 Share on other sites More sharing options...
waynew Posted December 13, 2008 Author Share Posted December 13, 2008 "Use server side sessions and scalability will be a nightmare." Server side sessions? Are there client side sessions??? New to me. The basic concept of a session is to load data on the server side based on a token provided by the client. I never insinuated that were client side sessions? Please keep the pedantry at bay. Quote Link to comment https://forums.phpfreaks.com/topic/136522-what-do-usually-go-for/#findComment-714519 Share on other sites More sharing options...
corbin Posted December 13, 2008 Share Posted December 13, 2008 There are sessions besides server side sessions? That is what I was trying to point out. I just used client as an example. By server side sessions, did you mean file system sessions? Quote Link to comment https://forums.phpfreaks.com/topic/136522-what-do-usually-go-for/#findComment-714637 Share on other sites More sharing options...
waynew Posted December 13, 2008 Author Share Posted December 13, 2008 Yes. Quote Link to comment https://forums.phpfreaks.com/topic/136522-what-do-usually-go-for/#findComment-714687 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.