Rails 5 on Heroku Focuses on New Version Strengths

0
1063

On Thursdays I like to cover a topic in the tech news sector, and specifically discuss how it relates to the development community, and so today I wanted to talk about getting Rails 5 on Heroku.

Throughout the past few years Heroku has grown to be one of the most popular deployment engines for Rails applications, I’ve personally used it in the majority of the courses I’ve taught because it’s a great offering for quickly getting a Rails app live on the web. However, with the ease of Heroku also came a number of limitations and typically I find myself having to migrate applications to other hosting providers such as Digital Ocean or Linode as soon as an app reached even a hint of popularity.

For the most part the Rails community seems to treat Heroku like a great prototyping tool, but not the best option when it comes to production application hosting. Well, based on the announcement this month from Heroku it looks like they’re trying to expand their offering in a number of ways.

I’ll put a link to the announcement to the show notes, however here is a summary of the features:

  • For Rails 5 on Heroku they’ve switched to using the Puma web server by default as opposed to the poor performing WEBrick server. This has always been possible, however with the integration of ActionCable in Rails 5 WEBrick is no longer a viable option, even in development. They also do some nice things such as matching your server thread count with the ActiveRecord thread count to prevent errors in production.
  • If you’re using Rails 4.2 or above Heroku will serve your static asset files, before that you would’ve needed to use the rails_12_factor gem, which is a nice convenience.
  • They’ve also integrated some refinements to working with logs, you’ll still want to use an outside add on such as Papertrail or Logentries, however the log files should now be easier to read.
  • You’ll be able to have a little more protection against destructive actions on your production databases. If you attempt to drop a database it will give you an explicit warning as opposed to simply performing the action. Hopefully you’re not in the habit of running rake db:drop on a normal basis, but now at least you’ll have an extra layer of protection.
  • There’s now better support for the SECRET_KEY_BASE config variable to help protect against developers checking their app’s secret key into source control.

Some of these items were developed in Rails 5 and Heroku is simply giving you an interface to access them, however it’s good to know what some of the key differences are.

Rails 5 on Heroku Announcement

rails 5 on heroku

LEAVE A REPLY

Please enter your comment!
Please enter your name here