hello guys, i am wondering what is the best way to store photos ?,
is it in a mysql table by using blob field ?
is it by placing it in a directory and maybe using mysql tables to store links to that directory and photos files names but then i have to be sure i have deferent names in one directory....?!!
i have read that its not good to store photos in directories because the maximum number of files in one directory is limited is that true ?
what is the proper and pro. way to store photos and there thumbnails ?
and how to produce a thumbnail from a givven photo is there a ready made tools and do we have to store it too in a database or just to generate it dynamically ??
there is lot of questions in my mind...lool !!!!
thanks.
I store all my photos on DVDs and CDs I would look at Staples, Wal Mart, and Target. You might be able to get them on sale at Best Buy. The price of writable DVDs has come way down, so you can get a pack of R+ for $20.
Microsoft: "You've got questions. We've got dancing paperclips
I assume that you are making a website.
Storing data in database is easier to maintain.
For thumbnails you can use ready scripts like:
How to Create Thumbnail Images using PHP
And, yes, if you would want to store them in files you'd have to assure that filenames are unique.
There is not a specific way your suppose to store photos. I have stored some photos in a database but that can get memory consuming... I think some databases use up to 4 copies of data to make it go so fast.
I saw an icon website who had all their icons in one directory, however I am sure it was maintained by a database.
When I'm just making a website the images are rarely over 50 I just throw them in a /images/ directory.
thank you for the help , i am wondering also if i have to store a thumbnail for each photo in a separated table or just generate it by using some php code ?
also i am wondering what is faster to pull a photo from a database like mysql or from regular file system dir.... ?
if i store all my photos in tables/database isnt the database would be too much big and slow because i will need to do queries and thumbnail calculations for each photo...is there a way to cach the table results and thumbnails to the hdd....?
The speed depends on how many you have in there. If you have a lot I'd just stick to a directory. If you wanna do a database since the thumbnail goes with the original image I would have a table like "id, display_name, photo, thumbnail" and save accordingly. If you want a directory system with a lot of photos I'd probably suggest while uploading rename it to the current date time (e.g. photo_03-03-2010_09-40-13.jpg) and then appending a "_thumb" before the ".jpg".
BlaineSch oK but what if you have 50,000,000 photos where and how we should store them and how we should create there thumbnails and do we have to store also there generated thumbnails and where .... ???!!!!
and i am wondering also why should a mysql be a heavy thing on the webserver memory ??
is it because of the huge tables/database or because the database will have to execute too much queries and the mysql server will consume lot of memory??? so what also if we store the same photos quantity in a regular directory then the file system operating system will consume the same load of memory to find or open any photo file *.jpeg for example !!!??????
please let us know what is the best method to store our photos ?? maybe its a hybird of both the mysql and file system and some php code that help coordinate between the two ??
i think its a confusing issue ???
for example what is better ?
if we have 10000000 photos ?
to store them all in one mysql with deferent id's and categories ......?
to store only there location in a file system in a mysql and to force a unique files names ??
.............
lets discuss all this....together
For a lot of files (which that is) I would store them in a directory with a unique name... hopefully they already have it. Depending on what your doing I probably would suggest putting the file locations in a database.
yes but storing your photos in a directory has a major disadvantage , becase all operating systems or file systems has a limit for the number of files in one directory i think its 65000 in windows......
so what you will do when you have 65001 photos ??!!!
isnt mysql is better because of that ??? maybe we should use some third party mysql catching objects or engine to reduce the mysql usage of both memory and processor ?????!!!!!!
please advice.... i am not 100% sure what i should do....what is the best correct direction.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks