Handling (very) large files with PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



*Handling (very) large files with PHP*

Hello, I am planning a project in PHP, and I have few unsolved issues that
I'd like you to help me...

The project will start by loading a file of about 50GB.
The file has a many objects with a pattern, for example,


Name: Joe
Joe likes to eat
-------------------
Name: Daniel
Daniel likes to ask question on the PHP Mailing List


Anyway, so, I am going to convert it into a database, and I insist on using
PHP for this.

So the questions are,
How would I open the file? will fopen fread($file, 1024) will work? if then,
how would I find the seperator, "------------------", without taking too
many resources?
I'll have a dedicated server for this project so I could use exec, so I am
wondering if I should use exec to split the file?
How many hours or days do you think it will take me to insert all of the
data, if I have about 8,000,000,000 (8 billion/milliard) entries (objects)?

After I insert all the data, I'll have to start working with it as well -
for example, having a list of all people and what comes after the word
"likes" in their entry.

What do you suggest? I am concerened I might not be able to fully acomplish
both high speed with working (example above) and both high speed when
watching the data and adding more "works" (as stated above) with PHP. What
do you think?
Since inserting to the database, after considering it, will probably be with
C. But if I wish to work with it - will PHP be good?

What database should I use for so much info?


Thanks, Daniel

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux