I’m building a website where users can upload photos and I’d also convert uploaded photos into thumbnails.
Planning ahead, if the website gets popular, how do I scale it out so that the images (both original and thumbnails) will be stored in and served from multiple servers? Maybe a cluster? Is there any open source software that would help me in this?
Thanks.
An interesting question.
I think that the most solid and easily scaled solution would be to use something like MogileFS which is a distributed HTTP based file-system.
Another approach which might be simpler to build is to just make sure you’re aware of how you would scale out your image hosting should you need to. Possible approaches could be:
– Use Amazon S3
– Implement the sharding/partitioning of images manually in your application, store the images on different backend servers (with slower/large storage) and then put a reverse proxy in front of it.
In my opinion MogileFS would be a great solution to this problem. To scale out should be trivial but the initial implementation might take a bit longer.