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.


In reply to Re^3: Compressing data structures for cookies by Herkum
in thread Compressing data structures for cookies by gwg

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.