Welcome Guest, Not a member yet? Register   Sign In
Store images on database or filesystem?
#11

[eluser]slowgary[/eluser]
I agree with you trs, I've just always (wrongly) tried to avoid using a table if I don't need to, thinking about performance. I do realize the error of this line of thought, it's just sometimes hard to get rid of. In this case, since after a database query I still need to read the images from the file system, I was just trying to think of a clever way to avoid the database and go directly to the file system but there are a bunch of good reasons to use the table (less code, probably faster anyways, no hole in sequence, etc.).

I just though I'd see if the smart community here had any magic weapons for what I'm doing. Thanks for the info guys.
#12

[eluser]Dam1an[/eluser]
A few comments gary
1. Already covered, but disk is slow, specially once you have hundreds of thousands of images on there
2. Would you not want to keep an optional description/title for the image, so you'd need to store that in the db
#13

[eluser]slowgary[/eluser]
I didn't even consider storing data related to the image since the product data is obviously already stored in the products table. In this case, I won't have need for data per image but in others it is very likely to be needed.

I've heard the argument many times that disk is slow, but where I get confused is that database tables are on disk just the same. Does mysql bypass the filesystem's method of disk access and keep it's own internal "file allocation table"?

I will be using a database table, but at first it just seemed like it might be a little faster to skip making a query, which is just dumb of me.
#14

[eluser]Dam1an[/eluser]
[quote author="slowgary" date="1243196859"]I've heard the argument many times that disk is slow, but where I get confused is that database tables are on disk just the same. Does mysql bypass the filesystem's method of disk access and keep it's own internal "file allocation table"?[/quote]

Yes, the DB may be on disk as well, but its all indexed for super fast lookups etc (and you can store the DB in memory if you want)
#15

[eluser]Asinox[/eluser]
But if the problem is performance .... i like to use this for $this->output->enable_profiler(TRUE);

i dont know which method is better, but ..is small website? disk... but im crazy..

u'll have more images that shutterstock.com ??, i think that shutterstock save images in disk.. but dont believe me

anyway remember what happen when u try to backup the database when do u have images... [ amount of space due to the images ]

read this please: http://www.webmasterworld.com/forum88/9091.htm




Theme © iAndrew 2016 - Forum software by © MyBB