Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

What is best practice to keeps dynamic or user submitted files between deployments? i.e. git aws.push simply removes existent app directory and then extract new version onto EC2 instance, but I need to keep some logs, settings and user submitted data stored on filesystem.

I'm about to mount S3 bucket, but I can't find any post-deployment hooks on AWS Beanstalk to trigger mount S3 automagically...

share|improve this question
add comment

1 Answer

I would rethink why your application is storing things to the local system to begin with. Having those files removed on deploys is only one problem. Another problem is that when your app scales to more than one instance, those instances will not know about any of the files on the other instances. It would be best to have your app use S3 for all of your storage, or use some other mechanism that is permanent and accessible from any instance that is running your app.

Another thing to think about is user sessions. If you were previously storing sessions on the server, then you need to do something different there as well. Once there is more than one instance of your app running, session data will be unreliable unless you store it somewhere accessible by all of the instances. Elasticache or DynamoDB might be good options for session storage.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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