Selecting a technology in which you will develop a web app is a challenge that every product or business owner has to face. If you make the right choice, it will give you a solid base for growth and expansion. If you choose wrong though, it may cost you an arm and a leg.
Ruby on Rails (RoR) is a popular web framework for web application development built on the Ruby programming language. As a full-fledged web framework, RoR offers many components of a successful web project, such as an ORM (Object Relational Mapping) system for business data and logic, routing, and application management out of the box. Still, to decide whether RoR is a good fit for your project, you need to know what makes this framework different from others. To help you build a deeper understanding of RoR, we are going to give an overview of its main strengths and limitations.
Advantages of Ruby on Rails?
So why Ruby on Rails? We find Ruby provides us with a combination of the best tooling, better quality code libraries and a more pragmatic approach to software. Plus, the Ruby community tends to have a higher calibre of engineer, who favour responsible development over the gung-ho approach that can be seen in other communities.
- Tooling — Rails provides fantastic tooling that helps you to deliver more features in less time. It provides a standard structure for web apps, where all the common patterns are taken care of for you.
- Libraries — There’s a gem (3rd party module) for just about anything you can think of. They are all publicly available and searchable through https://rubygems.org/.
- Code Quality — Generally, we find the quality of third party Ruby code to be significantly higher than their PHP or NodeJS equivalents.
- Test Automation — The Ruby community is big in to testing and test automation. We believe this is incredibly valuable in helping to deliver good quality software and is one of the reason the Ruby libraries are so great.
- Large Community — Pretty much every major city in the world has a Ruby community that runs regular meetups. It’s one of the most popular languages on social coding site Github.
- Popular in The Valley — History has shown that technology that’s been popular within Silicon Valley has gradually been adopted across the world. If you look at the big startup successes of recent years, such as Airbnb, Etsy, GitHub & Shopify — they are are all on Ruby on Rails.
- Responsible Developers — You tend to find Ruby developers are more closely aligned around the the rules of responsible development. If you start small, communicate well, tackle vertical slices, write simple code over smart code, share ownership etc, you tend to find your project ends up in better shape.
- Productivity — Ruby is an eloquent and succinct language, which when combined with the plethora of 3rd party libraries, enables you to development features incredibly fast. I would say it’s the most productive programming language around.
- Next Generation — Ruby on Rails seems to be the language of choice for a number of the popular online code schools, such as Makers Academy, Steer and CodeCademy. This should mean an increase in talented programmers joining the Ruby community over the coming years.
Disadvantages of Ruby on Rails?
Of course Rails does have have its disadvantages and it’s only fair that we share those in this post.
- Runtime Speed — The most cited argument against Ruby on Rails is that it’s “slow”. We would agree, certainly when compared to the runtime speed of NodeJS or GoLang. Though in reality, the performance of a Ruby application is incredibly unlikely to be a bottleneck for a business. In 99% of cases, the bottleneck is going to be elsewhere, such as within the engineering team, IO, database or server architecture etc. When you get to a significant enough scale to have to worry about Rails runtime speed, then you’re likely to have a incredibly successful application (think Twitter volume) and will have many scaling issues to deal with.
- Boot Speed — The main frustration we hear from developers working in Rails is the boot speed of the Rails framework. Depending on the number of gem dependencies and files, it can take a significant amount of time to start, which can hinder developer performance. In recent versions of Rails this has been somewhat combatted by the introduction of Spring, but we feel this could still be faster.
- Documentation — It can be hard to find good documentation. Particularly for the less popular gems and for libraries which make heavy use of mixins (which is most of Rails). You’ll often end up finding the test suite acts as documentation and you’ll rely on this to understand behaviour. This isn’t itself a bad thing, as the test suite should be the most up-to-date representation of the system, however, it can still be frustrating having to dive into code, when sometimes written documentation would have been much quicker.
- Multi Threading — Rails supports multi threading, though some of the IO libraries do not, as they keep hold of the GIL (Global Interpreter Lock). This means if you’re not careful, requests will get queued up behind the active request and can introduce performance issues. In practice, this isn’t too much of a problem as, if you use a library that relies on GLI, you can switch to multi process setup. The knock-on effect of this is your application ends up consuming more compute resources than necessary, which can increase your infrastructure costs.
- Active Record — AR is used heavily within the Ruby on Rails world and is a hard dependency for many of the Ruby Gems. Although we think it’s a great design pattern, the biggest drawback we see is that your domain becomes tightly coupled to your persistence mechanism. This is far from ideal and can lead to bad architecture decisions.
Ruby on Rails is definitely one of the best web development frameworks to consider for your next project. With RoR you can do pretty much the same as with other good frameworks.
The excellent community, a quality code base, the sheer size of the module database, and the maintainability of RoR applications made it the preferred choice for such successful projects as Airbnb, GitHub, BaseCamp, Zendesk, and Bloomberg. However, the devil is in the detail. RoR is surely a good choice if your project has tight deadlines and budget requirements. On the other hand, a less opinionated framework such as Node.js may be a better choice for innovative web development solutions that require a total control over the framework architecture, modules, database integrations, and server deployment. The same will apply if you are building I/O-heavy Real-Time Applications for which performance and scalability are a major concern.
Pros & Cons you must know before using Ruby on Rails for your startup. was originally published in Hacker Noon on Medium, where people are continuing the conversation by highlighting and responding to this story.