A SQL database is sometimes overkill if the amount of data to be stored is relatively small, or if the data is only written/read once (or at most a few times). But if you start having more than trivial amounts of data that you may need to access in different ways from multiple programs (or from multiple copies of the same program) then the SQL database gives you flexibility and speed, and you don't have to reinvent that particular wheel.
To get back to your particular example, I've implemented discussion boards (in perl) using three different back-ends. The first used NNTP and used inn as the "database" to store the discussion. The second used DB_File (one file per "discussion"), and the third used a SQL database to store the message meta-data (though not the message text - that was stored separately in the file system).
All in all the third technique gives you the most power, and the most flexibility, and automatically handles things like concurrency, update locking, etc.
If I had to do it again I'd definitely store this sort of data in a SQL database, unless it was shown that this solution wouldn't provide sufficient performance (though I'm not sure what other solution might provide better performance.)
Michael
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.