You have a few different options. Listed below in order of personal preference:
- Use Simple Storage Service (S3) to store the files.
- Add an Elastic Block Store (EBS) volume to your server and save files to the volume.
- Save files to a database (This is something I would not do myself but the option is there.).
When using OpsWorks think of replicable/disposable servers.
What I mean by this is that if you can create one server (call it server A) and then switch to a different one in the same stack (call it server B), the result of using server A or server B should not impact how your application works.
While it may seem like a good idea to save your user generated files in a directory that is common between different versions of your app (every time you deploy a new release directory is generated) when you destroy your server, you run the risk of destroying your files.
Benefits and downsides of using S3?
Benefits:
- S3 will give you high redundancy and availability to your files.
- S3 is external to your application server so if your server dies or decide to move it to a different region, you can continue using the same s3 bucket.
- Application Easy to scale. You could add multiple application servers that read and write files to S3.
Downsides:
- You need extra code in you application. You will have to use the AWS API in order to store and retrieve the files. Using the S3 API is not hard but it may require an extra step to get you where you need. Take a look at the "Using an Amazon S3 Bucket" walk through for reference. This is be the code they use to upload the files to the S3 bucket in the example.
Benefits and downsides of using EBS?
Benefits:
- EBS is an "external hard drive" that you can easily mount to your machine using the OpsWorks Resource Manager.
- EBS volumes can be backed-up and restored.
- It may be the fastest option to implement and integrate to your application.
Downsides:
- You need to assign it to an instance before it is running.
- It could be time consuming to move from server A to server B (downtime may be required).
- You can not scale your application horizontally. While you can create copies of the EBS and assign them to different instances, the EBS will not be shared.
Downside of using a database?
- Just do a google search on "storing files in database"
- Take a look at Storing Images in DB - Yea or Nay?
My preferred choice would be to use S3, but ultimately this is your decision.
Good luck!
EDIT:
Take a look at this repository opsworks-chef-cookbooks it contains some recipes to deploy Symfony2 application on OpsWorks. I have been using it for over a year and works quite well.