Welcome Guest, Not a member yet? Register   Sign In
Dealing with images
#1

[eluser]RS71[/eluser]
Hey

I'm currently making an app that lets users upload images to associate with their products and I was wondering how I should deal with images in regards to storage and such.

Currently when the user submits the form, the app takes each image and makes 3 versions of it and adds one DB entry. Now I'm thinking, lets say for each product I have 14 pictures, that's 42 images for each product. Now if I end up with +50.000 products I'd end up with +2.100.000 images, hrmm...

I'm not too familiar with this type of thing but how would a server deal with a folder with +2.100.000 images?

I'm thinking I could create the different versions/sizes of it on the fly but that would just bring the server to its knees no?

I'd appreciate if somebody could help me out.
Thanks
#2

[eluser]Colin Williams[/eluser]
First of all, there's no need to create all the image sizes in one go. Better to do them on demand, then cache the processed images so future requests can simply be served from the file system.

There's nothing wrong with holding a couple million files if you've got enough storage. It's not like you are going to iterate over that list of files all the time, if ever.

And you could offload the serving of images to CDN / cloud services like Amazon S3.




Theme © iAndrew 2016 - Forum software by © MyBB