News for hackers. Stuff that matters.
Re:Heroku Gets Sweet Logging by marcamillion on Monday December 13, 2010 @11:29PM (#2003129)
Prolly not the place to ask this...but I will go ahead anyway...I recently heard that if you have a Rails app that will be accepting files from users (e.g. say images/videos being uploaded) Heroku is not the best host to use.

Anyone have any thoughts/experiences with that? Is that complete rubbish or is there truth to it and why?

Re:Heroku Gets Sweet Logging by tpz on Tuesday December 14, 2010 @01:08AM (#2003299)
AFAIK, if you have a Rails app that will be accepting files from users, Rails is probably not the best thing to use. Ruby likewise, short of using something evented (and I say this as someone thoroughly enjoying working with both Ruby and Rails.) Seeing as you'll be tying up processes rather quickly that way, no?

That aside for the moment, and based on your S3-related comments nested below, I thought I might pop by to mention that I (using Rails on Heroku) have been handling uploads by using direct pre-authorized posting to S3 and it has been very nice to work with.

Re:Heroku Gets Sweet Logging by marcamillion on Tuesday December 14, 2010 @02:22PM (#2005355)
What I am handling is basically what Basecamp is handling. If Ruby and Rails can manage Basecamp, then it sure can manage what I am doing.

It's not so much the S3 storage I am concerned about. It's more the allowing me to backup everything properly, concern I have.

Re:Heroku Gets Sweet Logging by tpz on Wednesday December 15, 2010 @01:41AM (#2007303)
Regarding backup, I definitely understand the feeling.
Re:Heroku Gets Sweet Logging by mnutt on Tuesday December 14, 2010 @02:09AM (#2003423)
If you're using something like Passenger, I believe it does the upload in nginx/apache to a tempfile and then hands it off to Rails.
Re:Heroku Gets Sweet Logging by tpz on Wednesday December 15, 2010 @01:44AM (#2007306)
Thanks for that bit of info. At the moment things like Passenger are obscured from my view/concern, as I'm not managing the servers myself, but should that change I'll definitely keep that tidbit in mind.
Re:Heroku Gets Sweet Logging by nborgo on Monday December 13, 2010 @11:46PM (#2003160)
I'm guessing they said that because Heroku doesn't let you save files to their system. You have to use something like s3. Other than that, I see no reason why someone would say that.

You can save things to the tmp directory for a little while. The files should last long enough to do some work on them. For example, I've had an app parse an uploaded XML file that gets saved in tmp. This might not be a good practice, but I don't feel like setting up anything special for that app.

Re:Heroku Gets Sweet Logging by grahamr on Monday December 13, 2010 @11:45PM (#2003155)
I use the paperclip gem and store files on S3 with my Heroku apps and it works great. I believe this approach is very common.
Re:Heroku Gets Sweet Logging by marcamillion on Monday December 13, 2010 @11:55PM (#2003169)
I too am implementing paperclip...but I am wondering about backing up the uploads. How do you backup those uploads? I was thinking that I would store the first copy on the host - then push them to s3 for backup (and maybe 1 other CDN, just to be ultra paranoid).

But, it seems to me, that if you are just passing through Heroku altogether - that removes one point of fault tolerance and redundancy - right?