This article was originally published on Codica blog.
Nowadays, both startups and established businesses choose Ruby on Rails for web development. Basecamp, GitHub, Dribble, Airbnb are well-known brands that have built their websites with this framework.
So what makes Rails a good choice?
At Codica, we are big fans of the tool and want to share its main benefits and drawbacks.
First, let’s see what figures can tell us about the Ruby on Rails framework:
- According to BuiltWith, over 523,339 live websites are created with the technology.
- There are almost 4,000 coders who contribute to the progress of RoR on GitHub.
- Ruby on Rails has over 45,000 GitHub stars.
- Arc states that the average hourly rate of a Senior Ruby on Rails developer in North America is $121-140.
David Heinemeier Hansson created Ruby on Rails in the early 2000s while working on a project management tool called Basecamp.
The RoR framework is noted for its fast speed and ease of the web application development and deployment by many technical experts. Thus, Yukihiro Matsumoto, the creator of Ruby programming language, calls this tool “the killer app for Ruby”.
Over recent years, Ruby on Rails has been greatly improved with new functionality that strengthened its positions.
Ruby on Rails is an open-source framework widely used in web app development. It runs on Ruby and focuses on simplicity and refined output.
Its core principles allow entrepreneurs to spend less money. At the same time, developers can complete tasks faster and more effortlessly.
Principle: Don’t Repeat Yourself (DRY)
This rule states that every code snippet requires a single, unambiguous, and authoritative submission within a system. It makes an app code cleaner with fewer bugs. Besides, developers restructure the code or refactor it hands-down.
Principle: Convention Over Configuration
This concept supposes that systems, libraries, languages you work with assume lots of logical situations by default. Bearing this fact in mind, coders adapt to them and specify some unconventional aspects of a web app rather than create new rules each time. Thus, programming is getting easier and more productive.
When it comes to web application development, there is a great variety of tools to choose from. You should consider such factors as a learning curve, scalability, hosting requirements, ease of installation, documentation to make the right decision.
Below you can see the most significant benefits and drawbacks of Ruby on Rails.
1. Simplicity in use
RoR is famous for intuitive, compact, and easy-to-understand syntax which means the highest usability to programmers.
Ruby on Rails developers write less code. As a result, the process of creating a web application becomes faster. Owing to framework readability, there are no grounds to add comments. Consequently, the code is getting more understandable for developers.
Besides, as projects stick to the identical rules and philosophy, programmers can shift from one Rails project to another at any development stage.
In recent years, cybersecurity issues have become a serious problem for both developers and businesses. According to Cybint Solutions, shocking 64% of companies have faced web-based attacks. Meanwhile, 62% of companies became victims of phishing & social engineering attacks.
The chart below shows that the latter type of cybersecurity issues mostly aim at SaaS, financial institutions, and e-commerce platforms.
These alarming statistics explain why the security of your future solution is paramount.
Luckily, thanks to its built-in mechanisms, Ruby on Rails guarantees the resistance of your web page or app to common vulnerabilities. With this framework, your web product will be protected from the following threats:
- Cross-Site Scripting
- SQL Injection
- Cross-Site Request Forgery
- Insecure Direct Object Reference or Forceful Browsing.
3. High development speed
The framework offers a great number of free open-source libraries called gems. They extend or modify the existing functionality of web apps and provide developers with solutions to common issues. Whatever functionality you want to implement- odds are that you will find a gem for it.
Today, the quantity of Ruby gems has exceeded 158 700+ with over 48 billion downloads.
Also, there are library extensions and utility classes provided by a framework component called Active Support which is responsible for developing both Rails applications and the technology itself.
4. Enthusiastic community
Ruby on Rails has a vibrant community. Its active members create Ruby on Rails dedicated websites, forums, and chat rooms and provide developers with professional answers from coders who have experienced a similar problem and came up with a solution.
In addition, the participants are constantly creating guides, manuals, lessons, and other educational materials.
Finally, the community hosts RailsConf which is the largest gathering of RoR developers where they can share their experience with other fans of this framework.
5. Easy business logic implementation
Implementation of complex business logic in a web application is easy with Ruby on Rails. Suppose, you need API. Developers applying this framework will create it really fast. The only thing you should do is to add a front-end framework like Vue or React, and that’s it. You will get a ready web app.
6. Compatibility with front-end frameworks
Today such front-end frameworks as React, Vue, and Angular are increasingly popular. These tools are widely used together with Ruby on Rails due to the easy integration of RoR. You can take any framework you like and develop front-end components quickly and effortlessly.
1. Runtime speed and performance
Pretty often an application’s success depends on these two parameters. The great amount of apps available makes users more demanding. They don’t want to wait. Customers expect web applications to load quickly and seamlessly.
Google study shows how each second delay decreases the number of page views.
Runtime speed of Ruby on Rails leaves much to be desired. While it will be enough for small apps without millions of users, it may become an issue when building a solid web project.
However, the Ruby on Rails 6.0 version released in August 2019 touched upon this subject. Support for multiple simultaneous database connections is a new important feature. It can boost performance by allowing developers to use two databases to switch between them.
2. Lack of flexibility
With a hard dependency between components and modules, Ruby on Rails is a perfect solution for a regular web app. However, when it comes to an app with specific functionality, customization can be challenging.
Configuring routing, database migrations, and other elements slow down the web app development process.
3. Lower popularity
During the last couple of years, we have been witnessing a decline of Ruby on Rails popularity. The statistics provided by Google Trends shows a lack of interest in this framework.
Despite the increasing number of developers and the supportive community, the technology is not as widely used as, for example, Laravel for PHP, or Django for Python. One of the possible reasons is its steep learning curve. Developers who master Ruby on Rails, as a rule, know one or two programming languages.
For business owners, it means that hiring an experienced Ruby on Rails development agency may become rather a challenging process, if compared to finding a PHP, Java, or Python web company. At the same time, they get more experienced and skillful specialists.
Let’s take a closer look at the projects that are best suited for Ruby on Rails framework.
Ruby on Rails is one of the most suitable technologies used by startups. It is applied when building prototypes and for development, that makes Rails highly prized.
Such popular platforms as GitHub, Twitter, Airbnb, and Dribbble were primarily created with Ruby on Rails.
With the previously mentioned gems, you can implement basically any feature an e-commerce platform may need: from a payment gateway to a help desk. Your online marketplace will be up and running in no time.
Besides, you need to protect payment data and personal information of both buyers and sellers to build trust in the platform. At the end of the day, your ability to secure sensitive information of your clients can significantly boost customer experience. That’s when Ruby on Rails becomes the right choice.
Shopify, Fiverr, Groupon, and Etsy were originally based on Ruby on Rails.
When building SaaS products, security becomes the top priority. Ruby on Rail ensures the safety of your web product. There are lots of precautions to protect the data within this framework including usage of numerous gems for authentication and increasing password length, multiple built-in encryption libraries, skipping forgery requests, and strong parameters usage.
Basecamp, Zendesk, and GitHub are amongst the most well-known SaaS apps built with RoR.
To summarize, Ruby on Rails is an efficient, scalable, and secure web development framework which can help you build any kind of products: from e-commerce platforms to SaaS solutions.
However, RoR has some drawbacks as well that should be taken into account.
If you want to learn more about the subject, check our full article Pros & Cons of Using Ruby on Rails for Web Development.