Need a recommendation for shared storage on auto-scaling ec2 w/ scalr

amazon ec2amazon-ebsautoscalingload balancingscalr

I have come across so many answers to this question that I am completely lost! I am moving our 2 sites to a load balanced ec2 system with scalr as our cloud manager. Now the question is coming up about persistent storage for the user's uploaded content and other files. Could someone please give me a suggestion and possible a link to a tutorial for the following setup and goals.
2 websites (1 Forum, 1 ecommerce).
1 LB
1 App server (to scale out to as many as needed)
1 DB server (to scale out to as many as needed)

Our sites will need to autoscale and according to what I am learning about scalr, that means as new instances load up, I need to run a script to set the basics up on that server (git,php mods, pull site from git, move keys, etc)

What I don't understand is how should I handle user uploaded content like profile pictures, avatars, product images, themes, etc…

Do I mount an EBS or s3fs folder to hold the websites (maybe /var/www/websitefolder)
or do I do something like mount the avatar folders /var/www/websitefolder/images/avatars)

I am not sure where to go with this. Could someone give me some detailed help?
-John

Best Answer

This is a common issue when moving to EC2. Your options are one of the following:

  1. S3

    • Use s3fs as mentioned but you may suffer performance issues
    • Rewrite the application to store user content on S3 rather than disk.
      • You application could proxy the request to S3 or
      • You could get your client to upload directly to S3 using pre-signed URLS.
      • User could then be directed to retrieve content directly from S3.
  2. Use a clustered filesystem such a Gluster.

  3. Use 2 x dedicated NFS servers in Active/Passive using a DRBD backend.

EDIT 20160705

AWS now offers Elastic File System (EFS) in a number of regions. EFS is a hosted NFS service, effectively giving you a NAS as a Service.