What is Ruby on Rails?
Ruby on Rails is an open-source (no licensing costs involved) web framework that uses the Ruby language with its primary focus on building web applications quickly and without requiring a large team of developers.
Convention over configuration
It does that by prioritizing convention over configuration. So instead of having you tinker with configuration settings every time you create a new project, you can start with a default configuration that makes sense for a large group of web applications.
In my experience, nine times out of ten, you don’t need to touch anything. The rare cases when you do need to mess with configuration settings are usually around the time when you need to scale up.
It’s very likely that you will need to create a number of new applications from scratch, especially when you’re just starting to learn Rails.
You can generate a new app with just one command, and you can have it ready to go in less than a minute. Add some code to it, ship it, and either throw it away and start from scratch or continue adding new features.
This kind of flexibility and its vast pool of community makes Ruby on Rails ideal for startups or startup-like environments in which trying out various ideas as fast as possible can make or break the business.
Developer happiness
As a developer, you can skip a lot of the time-consuming parts that you don’t want to deal with anyway, and you can focus your attention on the one aspect you enjoy the most; writing code.
For example, most web applications have users and need registration, login, logout, remember me, and password reset functionality. You can have all that by writing a single line of code (importing a third-party library).
And that kind of pre-built functionality can be found for different areas of your application. How much time would something like that save you?
I’ve built Ruby on Rails apps for over a decade, and I write code relatively quickly. But it would still take me a few days to a week (or more) to rewrite all that functionality from scratch.
Also, these things add up quickly to a few months of coding if you were to write them yourself. You could use that time to add value to the product instead of reinventing the wheel.
And it’s not like you get something pre-built that you can’t customize to your liking. You can customize everything as long as you’re willing to trade your time for it.
Ruby code is very readable compared to other programming languages. This helps increase productivity and provides a better developer experience because you don’t need to write and maintain documentation.
All-in-all, Ruby on Rails can make you a productive developer. And if you’re running a business, you can pretty much build a product with a single developer that can handle millions of customers.
Performance / Speed
A lot has been said about both the Ruby language and the Rails framework regarding their slowness compared to other languages. And this is somewhat true. Bad code is slow in any language. But assuming you know what you’re doing, Ruby is not the fastest language out there.
Both Ruby and Rails intentionally optimize for developer happiness, high productivity, and quick prototyping.
And in practice, what this means is you need to be aware that not all applications are well suited to be built with Ruby on Rails. Especially the ones that have high demands in terms of performance.
It’s important to know what type of application you are trying to build and optimize for ahead of time. And you might decide that you will either build some parts of it with Ruby on Rails or none of them.
In terms of the real-life applications that I’ve built, I can attest that it can scale up to millions of users without problems. After you’ve hit that milestone, you can think about pulling out parts of the application that are slow and rewriting them in a more performance-optimized language.
You can also do many things to scale your Rails application, like adding more hardware, caching, and code optimization.