Re: [PHP] Re: Uploading Files Should I use MySQL or Server for storage?

2007-05-22 Thread clive

itoctopus wrote:
I have tried both, and I tell you that I really felt that the filesystem is 
a more convenient way of doing it.


I have to agree, filesystems were after all designed to store files. I 
reckon reading a file from disk is much quicker than reading from a 
database, maybe only fractionaly though.


--
Regards,

Clive.

Real Time Travel Connections


{No electrons were harmed in the creation, transmission or reading of 
this email. However, many were excited and some may well have enjoyed 
the experience.}


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Uploading Files Should I use MySQL or Server for storage?

2007-05-22 Thread Tijnema

On 5/22/07, clive [EMAIL PROTECTED] wrote:

itoctopus wrote:
 I have tried both, and I tell you that I really felt that the filesystem is
 a more convenient way of doing it.

I have to agree, filesystems were after all designed to store files. I
reckon reading a file from disk is much quicker than reading from a
database, maybe only fractionaly though.

--
Regards,

Clive.

Real Time Travel Connections


Ok, and what about Security etc? We only talk about speed here.
Databases are username  password protected. Files stored at the
filesystem are unprotected.
If you server files directly from the filesystem through Apache,
without interaction of PHP you might end up with people uploading all
kind of hacks. For example if they upload PHP files, and they get
served directly, then the PHP code will probably be executed.
Also, if you end up with a lot of files on one big disk (also for RAID
0), it would result in slow speeds for finding the actual data on the
disk. Read operations are faster, but for small files, a database
would be faster. This is probably not for your project, as you're
files are little bit larger. [Please, don't ask for benchmarks of
above statement.]

Tijnema

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Uploading Files Should I use MySQL or Server for storage?

2007-05-22 Thread Robert Cummings
On Tue, 2007-05-22 at 11:00 +0200, clive wrote:
 itoctopus wrote:
  I have tried both, and I tell you that I really felt that the filesystem is 
  a more convenient way of doing it.
  
 I have to agree, filesystems were after all designed to store files. I 
 reckon reading a file from disk is much quicker than reading from a 
 database, maybe only fractionaly though.

And databases were created to relate data. So if you're image is
related to something, then it follows using your naive logic, that the
image belongs in the database. It just so happens that database data
usually resides on the filesystem, and thus your logical argument is
still met. Thus, continuing to follow along this pendantic semantic
path, it makes more sense that the image be in the database since more
requirements are fulfilled.

As I'm sure you can see, this logic has holes in it :)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Uploading Files Should I use MySQL or Server for storage?

2007-05-21 Thread Jonathan

[EMAIL PROTECTED] wrote:

I am in the process of adding a part to my website which would include
pictures, pdf files, txt files, and excel files.  The files sizes
could be anywhere on average of 100k to 2mb.  Do you think I should be
uploading the files to a MySQL database or to my server?

I have head that there are pros and cons to both, but have never
really received a definitive answer that helps much.  I appreciate all
your opinions on the pros and cons of both.


benc11,

I store most of my data in both. when i do image processing i usually 
upload the image, store the original in the database, process the image 
into its subsequent sizes or resolutions and store them on the file 
system. If the images get lost on the file system or my application can 
not find them I have the original stored in the db for reprocessing.


I store files other than images, PDF DOC etc...  in the database and on 
the file system. i serve the document from the file system because 
regardless of the thread of conversation it is in my experience that 99% 
of the time it is faster to do so. if its not found i know i have a fall 
back in that it is also stored in the database so i serve that.


Sure my method uses more storage space, but I sleep at night knowing I 
have added redundancy.


Kind regards,

Jonathan

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Uploading Files Should I use MySQL or Server for storage?

2007-05-21 Thread Al

Best of both worlds may be SQLite.  ZEND has a nice article on the subject.

[EMAIL PROTECTED] wrote:

I am in the process of adding a part to my website which would include
pictures, pdf files, txt files, and excel files.  The files sizes
could be anywhere on average of 100k to 2mb.  Do you think I should be
uploading the files to a MySQL database or to my server?

I have head that there are pros and cons to both, but have never
really received a definitive answer that helps much.  I appreciate all
your opinions on the pros and cons of both.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Uploading Files Should I use MySQL or Server for storage?

2007-05-20 Thread itoctopus
I have tried both, and I tell you that I really felt that the filesystem is 
a more convenient way of doing it.

-- 
itoctopus - http://www.itoctopus.com
[EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
I am in the process of adding a part to my website which would include
 pictures, pdf files, txt files, and excel files.  The files sizes
 could be anywhere on average of 100k to 2mb.  Do you think I should be
 uploading the files to a MySQL database or to my server?

 I have head that there are pros and cons to both, but have never
 really received a definitive answer that helps much.  I appreciate all
 your opinions on the pros and cons of both. 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php