I'd say to do whatever is easiest for you right now (which is probably the db route) and localise the knowledge in your code.

i.e. the only code which knows that the profile is in the db for a user is the accessor which fetches it and makes it available to the rest of your site and the creation/update code which stores it.

Then you can change your mind later by:

  1. add a new column (profile_filename) to your table
  2. change your accessor to use profile_filename (if present) or the old column if not
  3. change your profile creation code to save as a filename
  4. run a batch job to create filenames for all profiles still stored in the db, populating the new column
  5. drop the old column and remove the backward-compat code from your accessors.
Which looks like a lot of work in a list, but isn't that much, really.

Also, you might find that you end up wanting your profiles in the db. If you need to scale, sometimes the best way is to replicate your back-end storage. If you're storing in more than one place (db and filesystem) you've complicated the process by which you do that.


In reply to Re: Member profiles - file or db? by jbert
in thread Member profiles - file or db? by Anonymous Monk

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.