Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: When is a flat file DB not enough?

by toma (Vicar)
on Jul 03, 2001 at 21:18 UTC ( [id://93588]=note: print w/replies, xml ) Need Help??


in reply to When is a flat file DB not enough?

32 bit operating systems typically have a file size limit of 2 gigabytes. Even if you have a 64 bit OS, many tools such as tar and ftp have trouble with files larger than 2GB, so don't exceed that.

I also like DBD::CSV, and if you need to switch from a flat file to a database, DBD::CSV makes this easy.

You didn't mention if you will need to load the whole file into memory at once. If you do need to load the whole file often, and it gets larger than about 50MB, it might be a good idea to use the Storable module. Storable stores and loads a perl data structure. It is amazingly fast and easy to use.

The downside of Storable is that it creates a file that is machine-architecture dependent (that is, not particulary portable). Also, it uses a binary file format, so you won't be able to browse it with a text editor.

It should work perfectly the first time! - toma

Replies are listed 'Best First'.
Re2: When is a flat file DB not enough?
by bikeNomad (Priest) on Jul 03, 2001 at 22:40 UTC
    Storable can be told to produce a portable structure by using the n* versions of its routines. It will then produce a network-ordered binary structure. So if you use nfreeze to serialize, just use nthaw to deserialize, and it should be portable.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://93588]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (1)
As of 2024-04-25 00:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found