Honestly, I would highly suggest an ACID-compliant db for anything where things are critical. Flat-files probably can be made ACID-compliant. But I wouldn't want to write the code to handle it.

Next best thing is MySQL (I realise that the default db isn't ACID-compliant, but I think there's an option to create a different type of db that is). Or PostgreSQL. Or ... (before anyone complains I'm anti-their-favourite-free-db, I'll say that the only one I have personal experience with is still IBM DB2).

I started writing a website for work once where I was trying to figure out exactly the same problem you're having: worrying about concurrent updates to my data storage. My manager explicitly told me not to use a database, worrying about the overhead. I ignored him once I got to the concurrency issue. I switched everything over to DB2. It saved my sanity (or what's left of it). Not that it was DB2 per se, but that it was an ACID-compliant server which took care of these nitty gritties and that I pretty much didn't have to worry about them anymore.

I can never recommend enough the use of the right tool for the job. And storing data is generally best left to database software. Those guys are way smarter than I am about these things, and, though I may be arrogant, I'm not that arrogant - not enough to think I can do in perl in a matter of hours or days what it took them years and years to do in C. (Perl is faster than C for development - but not that faster ;->)


In reply to Re: Append to a busy flat-file db without leaving customer in lurch by Tanktalus
in thread Append to a busy flat-file db without leaving customer in lurch by davebaker

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.