views:

29

answers:

2

I work on mvc.net application. Client is going to move production on a cluster environment. The problem is I store images in the local file system. Images can be dynamically uploaded by users through web site interface. How can I change the application in order to keep the images in working state?

The possible solution is the using of shared folder for all servers, but in that case I think I have to develop HttpHandler which will return images from this folder. So, it can affect the performance.

A: 

Consider using a CDN such as Amazon's S3.

Chris Martin
Client wants to avoid 3-rd party services
Egor4eg
+1  A: 

The possible solution is the using of shared folder for all servers, but in that case I think I have to develop HttpHandler which will return images from this folder. So, it can affect the performance.

Another option is to have a separate server dedicated to serving images & static files. You can tune it up for that purpose. When a file is uploaded, it goes to that server (which could or not be done through the other servers).

eglasius
Yes, this is a good idea. But there is one disadvantage here - maintenance of a separated web server.
Egor4eg
And I have a question to you: what is a better practice to write files to this server: just write them directly in the shared folder on this server or create a web service method which requires file and it's path?
Egor4eg
its a matter of how loosely coupled you want your environment. I'd really just use the network share for now, and only when needed move to a web service i.e. if you need to put in more than 1 place, run any pre-processing of the images/videos, etc. This is highly dependent on your specific environment and where you want to put the load / even processing queues would be used if the load were extremely high.
eglasius