If a particular site will need to use a database, whether or not a searching ability is needed, then storing the site index in a database table (or two) would be preferable (barring that the additional access will not hamper regular trafic access).

In you case however, I would do as the man says and use a DBM file. Because the site index can be stored in one table (without TOO much redundancy), a database is a bit overkill - especially for a small site. In your case with a 'flat ASCII text 400K file', using a DBM file in replace might be a little overkill as well - but I say take the challenge and learn something new. Then, start researching relational databases.

What is a Berkeley DB file? Well, the easy answer is that generally speaking, a Berkeley DB file is a more efficient way of storing data then a simple ASCII 'flat file.' A Google search produced this online reference. Give it a look.

As an added bonus, I found this dusty archived node in the monastery: DBI vs MLDBM/GDBM_File, etc.. You will find a lot of good information from the many posts in that thread concerning which type of data storage is best (which always depends on the situation).

Minor correction - Perl does not speak to SQL - Perl speaks to a database through a driver, and the language that Perl uses is SQL.

There will always be memory and speed issues with whichever approach you choose to store your data. A 400K file is a speck of dust to modern PC's - so you have nothing whatsoever to worry about. Except the concept of scalability - what happens when that 400k file becomes 400 gigs? That flat file just is not going to be able to survive the browser time out.

Last note - this is NOT an easy task on the whole. Just remember that, because you are probably fixing to take a long journey, and it will get rough at times. Here is another thread for you to ponder: Searching module

Jeff

R-R-R--R-R-R--R-R-R--R-R-R--R-R-R--
L-L--L-L--L-L--L-L--L-L--L-L--L-L--


In reply to (jeffa) Re: Search Engines for Dummies by jeffa
in thread Search Engines for Dummies by hostile17

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.