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
Related
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 followed this post to setup a wordpress site hosted on Heroku.
As an admin, I edited the stylesheet(style.css) and uploaded some images. It all works and the site is updated successfully. But after a while when I check the site again, our customized codes in the stylesheet and the images uploaded are gone.
Anyone can help me figure out why it happened and how should I fix it?
Find the same question and answer here:
"The problem is because Heroku doesn't allow you to have persistent storage on the Dynos. So initially when you upload the image it'll work but Heroku will sometimes restart your Dyno or move it to some other host (as they constantly shift applications to load balance their servers).
In order to make sure that your images stay online you should use a Wordpress Plugin that uploads to a persistent storage service such as Amazon S3. You could give this plugin a try: Amazon S3 for WordPress
The great thing about using Amazon S3 is that it's free for the first year if you use their Free Tier. You will have some limits but if it's a low traffic site, you shouldn't go beyond them easily."
Wordpress Heroku Featured Images not showing
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 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.
I've completed my website using a Ruby on Rails framework, which uses a simple database.
I have set up an Amazon S3 account and would like to upload it to this, however I've been told that I would need more than just this to get the website working.
I am COMPLETELY new to uploading RoR websites, so would anyone be willing to talk me through what needs doing/ why?
Amazon S3 is simply for storing static assets, images, css etc. You can run entirely static sites on it ie html but not 'applications'.
You may have misheard - you could use Amazon EC2 which provide you with a virtual server to host your application and run your application.
If you are entirely new to this process then I suggest you investigate the likes of Heroku (heroku.com) EngineYard, BrightBox, Rackspace etc With the first you probably would be able to use their free offering and deployment is simply by Git - there's no system administration involved.