PDA

View Full Version : help me out with storing user's files to MySQL DB instead of directories


ezstarsoft
2-10-04, 02:19 AM
due to files storing limitation policy of PW i have to change the way storing my user's files to my directories .
Owing to the fact that I am planning to build an online job agency service on my site like Yahoo's hot job service ( of course mine can not be compared this giant ) . I'd like to keep my user's photos as a part of their resume on the server . but the trouble is if i have more than 5000 users ( both employers and candidates ) and grant them to upload at least 3 photos , no sooner i would have reach the limitation of file storing ( 25600 both dirs and files ) ...so what now ? someone told me to use MySQL DB to store such files as binary data ( BLOB ) but i wonder if the system slows in functioning when i make queries for retrieving those data to show images on web page ? moreover i wonder if with all the resources i am having (1000 GB , 5GB bw/day ) , i can expand my online job agency system with more than 50000 (fifty thousand ) users ? if not possible surely i'll have to find dedicated hosting solution right ?
hey experts, super guru or whoever good at this ! help me out ! appreciate much ! good day !

Pig
2-10-04, 09:47 AM
HTH

http://www.zdnetindia.com/techzone/coding/stories/140.html

ezstarsoft
2-10-04, 12:20 PM
It sounds good but it would be painful for backing up & restoring for such amount of DATA especially when it grows tremendously with files (a medium size of a photo of about 600x480 dimension would be at least 20 KB for JPEG compression with 50% rate ). the way is not as easy as with storing in dir ! I wonder if such system can stand stably with more than 50000 users ...! cant imagine !
thanks anyway !

ezstarsoft
2-10-04, 12:32 PM
I looked through all the articles but they dont say how to get image data from DB and show it as thumbnail image ( resized one ) not original one !
so , this request bothered you once plz be bothered to keep helping me with it once again ! thanks in advance

Pig
2-10-04, 01:17 PM
This looks likely. Didn't read it carefully.

http://www.phpbuilder.com/lists/php-db/2001091/0393.php

cherria
2-11-04, 07:29 AM
Have you considered the other approach which is to set up multiple directories.

Maybe like Powweb does by surname initial or if you have a unique ID, maybe you have a directory for each 100 user IDs thus giving you upto 500,000 clients?

Or is the max photos is always going to be 3 you could have one directory per 1000 users giving you 5,000,000 clients

ezstarsoft
2-11-04, 01:10 PM
Well ! You seem not to understand the broblem .The trouble is you have the limitation of 25600 nodes either dir or file created by any mean ( FTP or PHP scripting ) in anywhere under your root directory ! and your behavior of making new nodes ( File or Dir ) is being monitored and recorded by POWWEB system ! i guess you would get an error from system if your nodes ( stands for files and dirs ) total reached the limitation ! THAT"S MY HEADACHE ! and that's why i changed to try DataBase solution . If only Powweb had the policy of limitation for each dir not for whole , well your solution would also be mine !

HalfaBee
2-11-04, 09:29 PM
Check out this link

http://www.onlamp.com/pub/a/php/2000/09/15/php_mysql.html

I did a google on
"storing images in mysql database" and this came up as a likely candidate


The reason for the overall file limit, is to stop the file allocation table growing too large and slowing down access times.