I can't see what the big deal is with shopping carts. Is there any problem with storing references in Session, and just recalling from the database the appropriate stuff?
Seems extremely straight forward to me? What am I missing?
It depends on alot of things. The implementation of using session variables like that is very straightforward. The problem comes with site traffic. If you have ALOT of it, the performance of the server will suffer if you use them. But this also depends on how much memory your server has.
If shopping carts have two items in them and you have 100 visitors on your site, and your server has 1Gb of memory, then you aren't going to see any problems -- your server can easily handle it -- assuming it isn't bogged down doing something else (db work, for example).
A good rule of thumb is never to store "objects" in session. They hog much more memory, and will degrade the performance of your server much faster. You might want to store a connection string rather than the connection, itself.
Like I say, though... it all depends on your server's resources and the amount of traffic you expect on your site. If traffic goes up and performance starts to suffer, add more memory. Session variables are definitely the easiest way to go.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.