No permanent filesystem for Heroku?

It is true. Heroku allows you to create cloud apps, but those cloud apps are not “permanent” – they are instances (or “slugs”) that can be replicated multiple times on Amazon’s EC2 (that’s why scaling is so easy with Heroku). If you were to push a new version of your app, then the slug will be recompiled, and any files you had saved to the filesystem in the previous instance would be lost.

Your best bet (whether on Heroku or otherwise) is to save user submitted photos to a CDN. Since you are on Heroku, and Heroku uses AWS, I’d recommend Amazon S3, with optionally enabling CloudFront.

This is beneficial not only because it gets around Heroku’s ephemeral “limitation”, but also because a CDN is much faster, and will provide a better service for your webapp and experience for your users.

Leave a Comment