I have successfully install load balancing and auto scaling on AWS based on it's official tutorial : http://docs.aws.amazon.com/gettingstarted/latest/wah-linux/awsgsg-wah-linux.pdf

but, I have a question once it's up and running :

as we all know, if we want to have load balancing, of course we will have multiple EC2 instance. my question is, how to create, update or delete a file in an EC2 instance then automatically sync across all available EC2 instance under a load balancer?

thank you.


Historically the best practice has been to store common file content in S3, but that requires some effort to either mount S3 in user space or run some type of syncing script.

The easier approach is to use a NAS that is mounted on all of the servers so they can share a file system. In the past that would have required quite a bit of effort. However, Amazon Elastic File System (Amazon EFS) sounds like the service you are looking for.

You would simply need to mount the EFS volume on all of your EC2 instances and they can share a file system. The major downside is that EFS is currently in preview.


To directly answer you, the alternatives to Elastic File System or S3 in this case would be some form of network file share. Leading, easier-but-not-easy contenders are SAMBA, NFS, and GlusterFS.

To more accurately solve what your problems are likely to be, consider files and data are not the same thing. If you need files on a host to be managed in a uniform manner, then a configuration management system is going to be the better route to go (e.g. Chef, Puppet, Ansible, or similar tools.) If you need arbitrary data coming from your applications or users, then a data store is what you need; something in the form of a database or cache (mysql, postgres, redis, memcached, etc.) It's worth considering in this case, that Amazon has databases available as well, look into RDS or Elasticache for these use cases.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.