in reply to Re^2: Compressing data structures for cookies
in thread Compressing data structures for cookies
If you are using CGI::Session with a database, having multiple machines would not be a problem. The reason for this is that the user would just a Session ID cookie. The session ID would correspond with a primary key on a 'sessions' table in the database. The database would contain all user settings and can store whatever information that they need for the duration of the session.
All you would have to do is point both web services to the same database where the session data is stored. Now it would not matter which server you go to and you can add a third or a fourth server, etc... and you would not have to change anything.
This would also apply to data as well. You can expand the number of user settings from your 402 bytes to 3 or 4 KB and you not have to change anything.
The other thing is that the volume of users is such that it is not feasible to keep the session data for every person
You have to keep the data somewhere. You stated that currently that the settings take up 402 bytes. Than means 1 MB can store settings for 2600 users. That is not much storage space at all.
, and it would be better for users to be able to have their settings persist between sessions.
If the data is persistent and is not needed for a particular session then store it in a table. You need someway of identifying the user, create a 'user' table and put everything in there.
Databases are not a limitation, they can manage thousands and even millions of records and gigs of data.
Cookies are what are limiting, move away from using them so much.
|
|---|