What hosting services can provide, supporting Ruby on Rails 3, can run a RabbitMQ server? - ruby-on-rails

I am using Ruby on Rails 3 and I am considering to implement messaging queues for my applications using the Advanced Message Queuing Protocol (AMQP).
So, relating to that arguments, I would like to know what hosting services can provide a RabbitMQ server (this is an open source implementation of AMQP).

I'd try something like Amazon EC2 or Rackspace Cloud, you have full control of the systems then.

Related

Hosting for Ruby (and Rails) like hosting for PHP

I was wondering if there was around a hosting as those that have existed for years for PHP that would give the opportunity to publish many Ruby and Rails applications and not as Heroku that forces a single application for dyno.
In classical hosting PHP I can create a folder, upload some files in php and navigate them through links.
You can something like that on some Web hosting?
For small projects, Heroku is really the best deal. Their free tier does everything you'd need for something that's occasionally used and doesn't have a lot of scaling issues. You are restricted to one application per "dyno", per account.
For anything more demanding it's not hard to set up a hosting environment on a VPS provider. Although it takes some additional knowledge, you'll be able to set up and configure a web server using a tool like Passenger and manage your own instances. For $10/mo. you can have a very capable server instance that will handle way more than a $7/mo. dyno can manage. Even the $5/mo. server from a provider like Digital Ocean is a fantastic deal.
PHP's fire and forget method of hosting is convenient, but it's actually a lot more work in the long haul compared to an efficient workflow based around Rails and Passenger.
For example, using Capistrano and a version control system like Git you can make changes, test locally, package up into a commit and deploy on your server within minutes. It's basically effortless once you get it working.
For small production projects, I use webfaction, it's easier to push to production than to configure a complete VPS as it's more like a managed hosting (with all the tools and documentation you need for rails) .
I use mina for deployment and Git for version control.
To complete #Tadman answer you can check OpenShift if you want a more Heroku like alternative.
When I started using Rails I was also tempted to compare and seek for a 'php-hosting' like solution. But it's just a different approach.
To answer your question more precisely, you don't drop files in a folder and navigate with links in a classic rails project. You have to understand the concept of MVC, routing ...
I suggest that you give the rails-tutorial a try, it is a good starting point for understanding the whole rails ecosystem.
You can try Ruby hosting on Jelastic PaaS with automated deployment to containers and scaling, as well as pay-per-use pricing model that makes it not so pricy.
There are pre-configured Apache and NGINX containers for running Ruby application, supported different Ruby versions, built-in Ruby on Rails framework, Passenger, Puma, Unicorn, Bundler dependency manager etc.
When deploying a Ruby application, only a single context (ROOT) can be used. However, you can switch between three deployment types: deployment, production and test.
More details are described here https://jelastic.com/blog/ruby-paas-hosting/
You can start with a free trial and test how it suits your project before investing any budget. This Ruby PaaS is available on different local service providers https://jelastic.cloud/

What plan(s) are needed to get Rails set up on AWS?

I'm new to Amazon's cloud though I have used other cloud provides like Rackspace, Windows Azure and Heroku. I want to deploy my Ruby on Rails 4 application on Amazon but I am overwhelmed with all of the services Amazon offers. AWS, EC2, EBS, S3, SimpleDB, Elastic Beanstalk.... argh!!
My site is a relatively simple Rails app with a Postres database. There will not be much traffic at launch but we obviously hope it will grow and need to scale up.
What is a simple, no-frills plan that Amazon offers to get my app out there? I feel like I need to read 100 pages of documentation just to understand what it is that Amazon is offering.
First of all, there are no plans. You sign-up for an AWS account, and you have access to whichever services you want to use.
Secondly, I can wholeheartedly recommend a single-instance Elastic Beanstalk environment to get started. It only uses 1 EC2 virtual server behind the scenes, but you get much better deployment options.
I can't speak to other services like Heroku.

Amazon Web Services with iOS

Good Day,
I have been more or less coding my own PHP scripts and using mysql for server-side stuff on my own server. I am quite interested in trying Amazon Web services.
Can I know if there is a free option to use their LAMP stack? Also, is there an iOS API available where I can create a database easily and just use the API for iOS to do retrieve data?
Yep there is a free tier option available where you can try a micro EC2 instance (a few AMIs already have Ubuntu + Apache + PHP5 installed as default) and a micro RDS (MySQL or others) database.
There is also a good iOS SDK available, even though it does not support all the AWS services.

WebSockets and Heroku: pushing data to the user

I am build a real time web application using Ruby on Rails and Heroku seems to be the best option for hosting it.
I would prefer pushing new data to the user, when it becomes available, instead of pulling it by sending AJAX requests every few seconds.
Pusher seems to be suggested by Heroku for a such kind of job, but it has some limitations, brings additional costs, and makes you dependent on an external API.
Is there any other option to use WebSockets on Heroku?
If you wanna do websockets you need to use a different server besides rails. And since your on heroku you don't have the flexibility.
Optionally you can host a websockets enabled node server on an ec2 micro instance. Then in your rails app when you want to push -- do a request to the node server and the it will go to the clients.
If you only need one way communication try using Server Side events.
There are two options that you can use with Heroku aside from Pusher:
1) Like Eric Fode mentioned above, you could use SSE given you don't need two-way communication. There is a Heroku add-on which you could leverage for this: https://addons.heroku.com/eshq
2) There is another lesser known library called Faye which you could look into. It supports both Node.js and Ruby servers and it's based on the Bayeux Protocol
Heroku now has support for WebSockets: https://devcenter.heroku.com/articles/heroku-labs-websockets
While WebSockets isn't currently supported, apparently you can use Socket.io on Heroku, configuring it for long-polling.

How to do site analytics with ruby on rails

I was wondering what are the options for doing site analytics with a ruby on rails application ?
I haven't seen any solutions specifically targeted towards rails - more towards apache type web servers. I don't want to use the google analytics, I'd like to have the logging/analyis all local.
After a quick look at wiki's list of web analytics software http://en.wikipedia.org/wiki/List_of_web_analytics_software, I can't see anything that I can see how to incorporate into my rails/ruby app.
AFAIK Rails deployments behind both Apache and nginx can both benefit from the host of tools developed for parsing web logs over the years. I loved AWStats :)
For application events not explicitly in the web logs - like logins, sign-ups, purchases - I'd recommend using keen-gem from Keen IO (Disclaimer - I work there). It's pretty easy - install or bundle the gem, then just add lines like this:
Keen.publish_async("sign_ups", { :username => "lloyd", :referred_by => "harry" })
anywhere in your Rails app to log events. Once the events have been logged you can use the workbench at keen.io to run queries and see visualizations, or you can use the REST API to pull any and all data back out for custom processing.
Most people deploy rails applications behind Apache or other web servers, because Rails applications can be set up to allow those web servers to quickly and efficiently serve static assets and cached pages. This also means that we can use the same log analysis tools we've always used like Analog, AWStats, etc.
Or we can just punt and use google analytics. I like row logs though :)
Hope that helps!

Resources