Databases have several advantages over files when it comes to storing and retrieving data. The principal buzzwords would be effecient, faster, scalable, maintainable, portable and so on.

Two reasons to consider _not_ using a file as a 'database' at all. There are other more compelling reasons, but these two really do matter.

1. A file stores its records sequentially, so the bigger the file gets, average transaction times increase linearily. Databases use an array of methods to leverage non-sequential random access, a much quicker and independant average transaction time is guaranteed, also growth of databases do not directly affect lookup times.

2. No implicit locking is done over individual records so you will have to explicitly lock the entire file before data manipulation or you potentially risk ending up with corrupt/incorrect data as a result of 2 or more simultaneous transactions. Locking an entire file means that during a long transaction, a queue of other transactions can build up and programming around this needs to be done carefully otherwise you end up with pissed-off customers, program deadlocks, crashes, data corruption, grey-hair, etc. It also gets worse as the size of the file grows. Databases on the other hand can lock individual records and most databses allow some simultaneous transactions, they multi-task and handle requests well, so already it's one big monkey off your back.

Files make bad busy databases, no buts at all. If you expect to have a backend that caters to more than a request per second, and you want quick, consistent lookup times, now or in the future, it would make sense to start off using a professional database now. You also avoid the big headache of having to migrate data over from the file to database later on, which you are bound to do eventually anyway. Databases might be complex and require a lot more work before the wheels start moving but they are the foundation(s) to both your technological (programming) and business models, so it makes sense to get them sorted out first and sorted out right as well.

In reply to Re: Member profiles - file or db? by Firefly258
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.