I've seen many posts talking about direct uploading to amazon S3 but none of them tell when we should really do that !
Is "direct upload to S3" always better than uploading to S3 via Rails app using gems like paperclip or carrierwave... ?
And when I should use direct upload vs normal upload to S3 ?
Uploading directly to Amazon S3 has the benefit of reducing load on your back-end web servers (for both CPU and bandwidth).
It is great for mobile apps that can call the Amazon S3 API directly, but is also applicable to web pages that can upload via a POST to Amazon S3.
Related
I have a web app in Rails that has a profile image upload, I`m using Refile gem to upload the photo direct to Amazon S3.
But now I need to do this upload from a mobile app too.
Witch is the best way to do that?
I think about a Rest API in Rails that receives the binary data and then uses Async Jobs (Sidekiq) to upload to Amazon S3, but and not sure if the approach is best way.
Can anyone help me?
Thanks!
I have a Rails app on Heroku that seems to be having trouble scaling the way I want it to. In the app, a user can upload multiple nested images to an invoice. Based on my research, it seems that this ties up a Heroku web dyno (I'm running 3) until it's done uploading. I've looked into Carrierwave Direct so that a web dyno isn't used but it doesn't seem that this is compatible with a nested model. Does anyone have any other suggestions?
Don't upload images to Heroku. It will lock your entire web server. Instead, use a jQuery library (https://github.com/blueimp/jQuery-File-Upload) to upload directly to Amazon S3 from the client side.
I'm building a rails application where users may want to upload images occasionally. Is there a way to have the users seamlessly upload the images to a remote host, like imgur, and store the URLs to the images in my database so that they can be displayed when needed?
I want to give the impression that they are uploading images directly to the database while actually offloading them to imgur. Is there a gem that does this, or does anybody have a good way to implement this?
Thanks.
Not sure about imgur, but if what you want is simply storing the images on the remote server, I think s3 + paperclip can be a good choice.
aws sdk: http://aws.amazon.com/articles/8621639827664165
paperclip: https://github.com/thoughtbot/paperclip
Using "gem 'carrierwave'" and "gem 'fog'" to upload to Google Cloud Storage or Amazon S3 is probably your best option.
http://railscasts.com/episodes/383-uploading-to-amazon-s3
I'm developing my personal photography portfolio using Ruby on rails. I'm not at all saving those images in my assets/images folder as there are many high resolution images which will cost increase in size of the site folder. So i thought to upload those pics on some image hosting websites so that ill only give a URL of that pic which will dramatically cost in decreasing the size of the site folder. Ive three questions regarding my portfolio:
1. Is this the right way to do for portfolio websites?
2. What are the best image hosting websites for such need?
3. On what basis ill use the database for my portfolio?
Thanks.
You should check out some CDN (Content Delivery Network) service like
Amazon S3 + Amazon CloudFront
Rackspace Cloud Files
Cloudinary
Ruby has many gems for managing cloud services like these.
For example:
fog gem (actively developed by guys at Heroku and Engine Yard)
cloudinary gem
carrierwave gem (handles automatic uploading to CDN and database storage)
carrierwave + cloudinary (easy tutorial here)
You could also use Paperclip which can link to AWS as well to store all the images and manage the storage logic as well.
https://github.com/thoughtbot/paperclip
I am building a ruby on rails website that will store and stream videos. I am using carrierwave and amazon s3 to upload and store the videos. If I am not mistaken, I can stream the files directly from s3 to my website.
So can anyone explain why does it seem that everyone uses cloudfront along with s3. What are the benifits?
What will be the average cost of such a storage/serving solution.
I will be streaming the videos via html5 so i will not be looking at encoding solutions
The main advantage to CloudFront is that it's a CDN. So the content is positioned closer to your customers, rather than just in Amazon's main data stores. You can use CloudFront with or without S3. It has a concept of an origin, which is basically the master server for your content. That master server can be S3 or a non-Amazon server.
For pricing, you should look at the CloudFront pricing details, and optionally the pricing for S3 (if you use that as origin).
You can use the calculator to estimate the actual cost. Let us know if you want help with that.