This topic is locked
[SOLVED]

 saving photos

1/11/2010 12:09:49 PM
PHPRunner General questions
H
horsey_kim author

I need some input.
I am building a network of websites that will use the same database. I have it down to two ways I think I will build it. All the websites share the same localhost. So saving to the one database with multiple websites works well.
However which is better?
To save the photos in the mysl database or to save it in a directory and reference by url?
Theses sites will probably be used by several thousand people and a total of about 10 websites contributing. All the database listings will include at least 1 to 6 photos.
So based on that info, which method of photo saving do you think is best?

K
KevinMillican 1/11/2010



I need some input.
I am building a network of websites that will use the same database. I have it down to two ways I think I will build it. All the websites share the same localhost. So saving to the one database with multiple websites works well.
However which is better?
To save the photos in the mysl database or to save it in a directory and reference by url?
Theses sites will probably be used by several thousand people and a total of about 10 websites contributing. All the database listings will include at least 1 to 6 photos.
So based on that info, which method of photo saving do you think is best?


I would recommend that you save the photos as files. In my experience this improves database performance considerably.

It has the added benefit that it is far easier to manipulate the database (ie. import/export/backup) at a later date, as it's always easy to move the files separately.

I recommend that you use the timestamp feature on filenames to keep them unique, unless you use code to rename them (ie. are basing the filename on an autoincrement field)

H
horsey_kim author 1/11/2010

Thanks Kevin, I think those are good points. I will plan for files in a directory.
Have a great day, Kim