Though in these times of anxiety and uncertainty, it is easy for software maintenance to inadvertently be put on the back burner, if you are currently utilising a Ruby on Rails (RoR) application, your software could be in need of a critical update. The problem lies in the deprecation of Cedar-16, an OS image based on Ubuntu 16.04, and upon which Heroku depends. Yet there is more to updating your Rails product than just waiting around for the next deprecation.
Before we get into it, however, it’s important to answer a common question:
What Does Deprecated Code Mean?
Reaching deprecation is just a natural part of the software life cycle. While you focus on evolving your web product, the same process takes place in the background for every component of your current tech stack. As a result — given enough time — some tech stacks are bound to become outdated or obsolete. The flipside, of course, is that a better version of your current tech stack should also then be readily available.
While developers are often racing to try to keep up with the latest updates, the cold hard truth is that this isn’t always a possibility, and many products thus retain the older versions of their frameworks and languages.
What Version Should I Upgrade To?
When it comes to Ruby on Rails, however — as with many other technologies — deciding which version to upgrade to is not as straightforward as you might initially expect. This happens because there are many differences between various versions of the Rails framework, and some versions will serve your product better than others.
So with this in mind, in order to make this decision, developers take a number of things into consideration. For instance, if you were currently utilising RoR 4, upgrading to RoR 6 (the latest version of Ruby on Rails) would take a minimum of six months. Yet because you will likely be inclined to deliver new features as well, it would probably make more sense to upgrade to version 5.2 instead. In this way, you can upgrade significantly faster and put the time that you have saved towards investing in feature development.
After all:
- your team wouldn’t waste any time switching over from the asset pipeline to the new pre-processor and bundler webpack
- Rails 5.2 is the first version compatible with webpack, so once the upgrade were finally complete, you could work on switching to webpack between implementing new features
- The steps above would make upgrading to RoR 6 easier in the future.
How to Plan a Ruby on Rails Upgrade
When planning your upgrade, it is important to discuss with your team members what exactly you are hoping to achieve. Your development team should then compare your project’s requirements with every available RoR version, and decide on what makes sense from a technical perspective.
Though it may not always be possible to thoroughly analyse hundreds of gems (i.e. libraries) and compare their individual versions in addition to any accompanying dependencies, you can look at every gem in your product and see how far they’ve come since you last updated your application. This will likely reveal a number of unsupported libraries. For instance, if you find that the latest versions of 15 gems were released between 4 and 5 years ago, this will mean that they are no longer supported — so in order to avoid any issues, it would certainly be best to replace them.
Is Updating Both Ruby and Ruby on Rails Important?
In general, this will depend on a variety of different factors. After all, both Ruby (the programming language) and RoR (the framework) can in most cases be updated independently, but RoR will always require a minimum version of Ruby to function. For example, the latest version of Ruby on Rails (6.1), requires Ruby 2.5, which was released back in December 2017. Apart from Rails, however, there are equally some other libraries which may require higher Ruby versions.
In any case, even though upgrading Ruby should not lead to any noticeable improvements, from a security and performance standpoint, it is advisable to upgrade both.
Top 5 Reasons to Update Your Ruby on Rails Application Today
So finally, with all of this in mind — and without further ado — here are Software Planet Group’s top 5 reasons why you should probably update your Rails application today:
1. Protect the integrity of your application
While software updates will often offer a plethora of tangible benefits, RoR updates in particular include patches for known vulnerabilities (see CVE for some recent examples). After all, without these critical security updates, hackers may easily gain access to your systems and unleash attacks like DoS and others.
2. Protect your data
From emails to bank accounts to personally identifiable data, by neglecting your application’s update, your information may no longer be secure. This should be particularly concerning for all types of businesses, as so-called malware may be employed by hackers to steal data from your company’s software, enable criminals to encrypt your data and even steal your company credit card.
3. Equip your business with the very latest
Updating your Rails products should also bless your business with some incredible new features and improvements. By and large, this will come in the form of increased stability and faster applications, but of course — as a welcome byproduct — it can also lead to positive feedback from users.
4. Guarantee support longevity
As a general rule, when tech stacks reach the stage of deprecation, they can no longer be given critical updates or the support that many businesses need. Yet in the case of Ruby on Rails and Heroku, this is actually much worse than it seems. In fact, companies are being blocked from pushing any code changes at all! In practice, this means that while your application might still be running, if you need to release a bug fix or deliver an important feature, your company will be unable to do so.
5. Save Time
By keeping your Rails application up to date, you guarantee that all of your software libraries will also be kept well maintained. For example, should a gem you use no longer be supported by the framework, you will still have more than enough time to find another replacement library or rewrite the gem using your own code. By contrast, if you choose to delay the inevitable, you may suffer a severe loss of time.
Challenges to Overcome
So that’s it for our reasons to update your Rails application, but what challenges can you expect along the way? Gathered below are some of the commonest:
- The greater the difference between RoR versions, the more complicated the upgrade will be, as you will likely face compatibility problems
- While it’s best to upgrade one minor version at a time (e.g. 3.2->4.0->4.1 and so on), this also means that with every iteration, you will have to test the entire system again to ensure that the software remains error free
- To avoid any deprecation issues, you will have to update your Rails solution with every minor and major release (there is usually a year in between releases).
Understandably, the problems above may seem a little daunting, but thanks to a thriving Ruby on Rails community, solving most of these challenges is just a Google search away.
Should You Upgrade to a Ruby on Rails Alternative?
To answer this question in particular, it’s important to note that “upgrading” to an alternative technology is essentially the same as rewriting your application — or at least parts of your application — from scratch. Nonetheless, there are certainly some isolated cases when developers may prefer to take this route.
Particularly in the case of microservice-based systems, or when attempting to improve an underperforming aspect of the product, you can rewrite the system with alternatives like Django and Laravel and connect it to the existing backend. As always, however, this will depend on your individual software solution and what exactly you are hoping to accomplish.
Evaluate Whether You Should Update Your Ruby on Rails Application Today
In these uncertain times, perhaps the most valuable thing you can do for your business is to take the time to reevaluate your software products — so if you’re currently making use of a Rails system, we recommend evaluating your position on the version history and planning your upgrade to a more recent tech stack.
What Are You Waiting For?
With decades of experience and a cracking team at offshore prices to boot, SPG are here to get your business through the toughest of times.
Upgrade Today!