in reply to Large Constant Database in Text File

I'm not going to second (third? fifth? whatever... ;-}) the SQLite route. Well, not right away.

It seems that you have some sort of aversion to RDBMS's that I don't fully understand, but we can work with it. I suggest you convert your application to use DBI with DBD::CSV instead. DBD::CSV, contrary to what the name seems to imply, can use pipes as delimiters just fine, if you tell it to.

Once you've done that, you can fairly easily swap out the underlying datastore from flat, pipe-delimited files to SQLite or mySQL or DB2 or Oracle or ... whatever you want. Largely, this will mean just changing the DBI->connect line after moving your data over.

To be honest, DBD::CSV has been sufficient for me for a number of projects. But none of them have 15,000 records ;-) I went down this road thinking "this is a bunch of data - I should use some sort of query language to retrieve it, but I don't want to set up a database for only 200 records." So I used DBI to ensure I can switch out the underlying data structure at will. Or at least something close to "at will" - if someone writes a DBD::XML, I could use XML to store the data, but in the meantime, I have a lot of flexibility.

I would predict that once you convert this way, you'll be tempted to look at the real DBMS's, and, once you do, you will wonder why you took so long to switch. Your lookup times will drastically drop, and your manager will really like it. ;-)

  • Comment on Re: Large Constant Database in Text File