Store file in multi instance app

180 Views Asked by At

We are developing an web application using Spring framework. We would like to deploy it on multiple instances of Tomcat load balanced by Apache.

Our users will be uploading multiple documents(doc, xlx, images) on to our platform. These file will be accessed by multiple users. My question is how to effectively manage these files in case our application is deployed on multiple servers so that every server can easily access these files.

1

There are 1 best solutions below

0
On

The simplest approach that comes to my mind would be a shared folder using NFS. That way you would mount that shared folder on each instance that would need access to such files. An additional effort here is needed to setup a high available NFS storage, and depending on the amount of requests you will need to think in a way to balance it.

Another solution would be the use of a service that would abstract such complexity, such as S3 from amazon. This way you would store and retrieve files from such storage without the concern of balancing and redundancy.