What’s the best practice for leveraging s3
I’ve got a Rails app that’s hosted on Heroku. It’s storing some logos and other images on S3, via Paperclip. I’m trying to setup a staging environment. I’d like staging to be as close as possible to production. Toward that end, I was planning on having staging and production look at the same s3 bucket.
I’m wondering:
- If this is a good practice or whether I should duplicate the production s3 bucket for the staging app.
- If if it’s possible to have production and staging feeding off the same s3 bucket. (I only ask because I tried and it’s been erroring out. Am not sure if it’s related to this or a separate issue.)
Yes, you want different buckets. Simple reason, an asset gets uploaded to staging and the new ID in the DB is say 10, your production app already has an asset of ID 10….uggh, you can see it will get messy very quickly.
Bother carrierwave and paperclick support different bucket names – either in the initializer or in the relevant environment file.