0

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.

Amro
  • 123,847
  • 25
  • 243
  • 454
Egor4eg
  • 2,678
  • 1
  • 22
  • 41

2 Answers2

1

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
  • 35,831
  • 5
  • 65
  • 110
  • Yes, this is a good idea. But there is one disadvantage here - maintenance of a separated web server. – Egor4eg Sep 28 '10 at 20:47
  • 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 Sep 28 '10 at 20:55
  • 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 Sep 28 '10 at 21:34
0

Consider using a CDN such as Amazon's S3.

Chris Martin
  • 1,871
  • 16
  • 17