I am working on an e-Commerce retail website. I have been asked to implement a functionality to keep a track of the last 5 products viewed by a shopper. A product is uniquely identified by two strings. I wanted to know from the gurus as to where should this information be stored. It is obvisouly possible to store it in the session, but since it is a high traffic website i am concerned what performance impact it might have? Is it possible to implement it in any other way? Thanks
Joined: May 29, 2003
Well, if it's not in the session it has to be somewhere else. Some possibilities:
other wacked out places?
Since you have stated that it is only ten strings total for each session, it wouldn't be that much of a drain on resources. It is certainly quick to take things from the session and do stuff with them. The database routine eliminates the need to place that data in memory all the time, but it takes much longer to get the data in order to use it. Cookies eliminates both those problems, but putting things in cookies opens up a whole different bag of problems for you (like, what if they don't allow cookies). Before ruling out the session (which I would recommend), take a look at your memory requirements. How many sessions do you expect to have open all the time? How much memory will be used up by each session object? Is there enough, or not enough? If there is enough, then go for it. If not, then freak out and look for some other solution.