Trust me, Ruby on Rails is Fast!

Miko Dagatan
Miko Dagatan October 29, 2024

For at least a decade, Ruby on Rails (RoR) has become a popular framework for web development and has been the backbone of many popular websites like GitHub, Shopify and Airbnb. Some developers and critics say that Ruby is slower than other languages. Despite assertions that Ruby on Rails is slow, web development using this framework remains efficient and fast. This is because web development involves not only the framework itself but also the integration of other technologies like databases, caching, and view layers. I'll explain why Ruby on Rails is fast and claims otherwise are unfounded.

1. Ruby on Rails Emphasises Developer Productivity

Developers often opt for Ruby on Rails due to its emphasis on "convention over configuration" promoting development cycles by reducing the need for coding and decision making on minor technicalities. The approach involves focusing on business logic rather than getting bogged down in mundane boilerplate tasks, and although this doesn't directly impact runtime performance; it does facilitate swift prototyping and shorter development durations. In a lot of business situations getting a feature to market quickly is often more important than focusing on speed improvements.

This is not about the speed of the application, yet. Rather, it's about the speed of delivery. We cannot ignore the fact that applications built on Rails tend to be inherently the fastest when compared to other languages + framework combos. We have this advantage when creating our applications, and this is an important consideration when choosing the right framework.

  • Myth: "Ruby on Rails is inherently slow."
  • Reality: This is not true. Modern Ruby is fast enough to handle expensive calculations. Meanwhile, Rails focuses heavily on speeding up developers' work to facilitate product development cycles and optimal performance in settings when appropriately set up for production use.

2. Ruby on Rails and Performance Optimisations

Though Rails may not reach the speed levels as languages such as Go or C++, it is quite fast when developers leverage it effectively. Ruby on Rails, has seen enhancements over time, with the rollout of Ruby 3+ and Rails 7 and 8 updates. These advancements have enabled applications developed on Rails to run fast enough to the users' satisfaction. Furthermore, utilising caching and making optimisations within ActiveRecord enables developers to effectively handle volumes of data, which eases the strain on the database and enhances the speed of page rendering.

  • Myth: "Rails apps can't scale or handle high traffic."
  • Reality: When you have caching in place and optimize your database indexing while also efficiently managing background job processing (using tools, like Sidekiq) Rails applications can handle scaling. Shopify and GitHub are illustrations of websites built using Rails that operate seamlessly at a large scale. With developers like those at reinteractive working with you, we can ensure that your application scales smoothly.

3. Boosting Productivity with Rails and Full stack Development

Rails has a feature where the backend and frontend work smoothly together. Rails 7 includes Turbo and StimulusJS (HOTWIRE), which utilises the advantages of Single Page Applications (SPAs) while minimising Javascript code. This can lead to signifant performance improvements while also improving developer productivity when creating special behavior.

  • Myth: "JavaScript frameworks and SPAs are always faster than Rails apps."
  • Reality: The common belief that Single Page Applications are inherently faster can be deceiving as they may actually entail downloading JavaScript files which can slow down the loading times despite providing seamless transitions, between pages. Ruby On Rails coupled with HOTWIRE provides user experiences without the burden of a fledged SPA.

4. Rails interfaces with other technologies (like other frameworks)

Rails is paired with various technologies to complete its web development needs. It has an RDBMS Databas, such as MySQL and PostgreSQL, in-memory data structure store such as Redis, Content Delivery Networks (CDN) such as Cloudflare, and the like. Several experienced Rails developers would argue that it's through interfacing with these technologies that would most likely add slowdowns, and the reason behind that is unoptimised code.

  • Myth: "Rails is inherently slow when interfacing with external technologies compared to other frameworks"
  • Reality: All modern web frameworks, including Rails, rely on external technologies such as databases and CDNs for performance and scalability. The perceived slowness often results from unoptimized database queries, lack of caching, or poor server configurations, not the framework itself. When Rails is properly optimized with techniques like query optimization, caching, and background job processing, it delivers performance that are basically the same or even faster with other web frameworks.

Conclusion

In the world of web development, frameworks rely on external tools such as the database in order to deliver a complete application. When interfacing with these tools, it's better to write as many efficient code as possible. When the developer fails to do so, he may think that it's the framework's fault that such detrimental results occur. And, this is what other developers think whenever they've come across such problems. This should not be the case. We need to ensure that we optimise our queries, add database indexes, cache expensive calculations, delegate to background jobs, and delegate functionality to other architecture properly to the right tools.

Inherently, Rails is fast when approached correctly.

Boost the success of your project with reinteractive's services!

We've explained that Ruby, on Rails is fully capable of creating dependable applications. The next question might be "Who will develop my Ruby on Rails application to guarantee performance for our website?" We can take care of that for you. With our team of developers and agile development approach we are confident in providing you with the technology you desire. In this scenario we assure you of development and fast operation of our web applications. Check out the feedback from our past and present customers, about the services we offer.

  • "After our engagement with reinteractive, we could tell that they cared about the project and our goals as much as we did, and they were going to be with us every step of the way. We were never going to be back of mind as a secondary project. The fact that we were assigned a dedicated team for our project exemplified this high level of care and this has continued throughout the project.” - Cella Ford, Compliance Manager, APCO
  •  

  • "We have people on the road meeting our customers. After the website revamp, there was a very consistent comment that our customers were finding our website a lot more user friendly. They all say it looks great. That feedback is a testament to the good work that has been done by reinteractive." - Yi Ho, Manager, Strategy and Marketing Manager, Sterling Parts
  •  

  • "The difference with reinteractive is the talent pool - Mikel has captured the best talent in the country. The consultants are top resources; self motivated, passionate and upfront.” - Simon Farrell, CTO, Redii

 

Ps. if you have any questions

Ask here