Ruby on Rails is a model–view–controller (MVC) framework of the Ruby programming language and has a wide range of use in developing backend applications.
Over the years, Ruby on Rails has grown to be one of the most popular frameworks for server-side development, and the recent 6.0.3.3 update aims to make it more secure than ever.
Ruby on Rails (commonly called “Rails”) is widely used across major companies. GitHub, for example, has some of its backend infrastructure running on Rails. Shopify uses Ruby on Rails to run much of its backend infrastructure, which in turn powers over 500,000 ecommerce stores worldwide.
However, with technology constantly evolving, other frameworks have emerged, presenting alternative means of building and maintaining backend infrastructure. This article highlights 11 Ruby on Rails alternatives for those who prefer not to use Rails or want to use other technologies.
If you want an alternative that has a similar feel to Rails, Sinatra is one of the most popular choices available. Leveraging the Rack web server interface, Sinatra works by providing a domain-specific-language (DSL) that matches a route request to its corresponding block of Ruby code. If your application does not require the complexity of larger frameworks like Rails, Sinatra is one great option you can try.
With over 64,000 stars on Github as of September 2020, Laravel, which stemmed from Symfony (another Ruby on Rails alternative listed in this article) is one of the most popular frameworks for backend development available in 2020 — and this is not without good cause.
Laravel is arguably one of the best-documented backend frameworks and is an excellent choice for beginners and experts alike who want to build full-stack web applications and APIs. Aside from its thorough documentation, one of Laravel’s main selling points is its Eloquent ORM, a simple and performant object-relational mapper that helps simplify database related operations.
Django is an MVC framework of Python that is widely known for its ease of use and speed. With the large amount of tutorials available online, as well as over 51,000 stars on GitHub, the Django community is one of the most popular backend frameworks for web development.
Django’s “batteries-included philosophy” — meaning it includes common utilities rather than forces users to have third-party libraries — is another reason developers love this framework. For example, routing, authentication, ORM, database migrations, and templating are all included by default in the framework.
With over 23,000 stars on GitHub and counting, Symfony is a set of reusable components and utilities and a framework that shouldn’t be overlooked. Originally developed in 2005 by Fabien Potencier, Symfony has become the open-source framework of choice for thousands of developers around the world. Symfony uses the Doctrine toolkit as its ORM and is the base framework of other projects such as Drupal, phpBB, and Laravel.
Express.js is a web framework that helps make building apps with Node.js faster and more convenient. Express.js stems from the Node.js middleware Connect, so most things that work with Node.js will work in Express.js as well.
One advantage Express.js has over other frameworks is that it aims to be as un-opinionated as possible, meaning that it gives developers the freedom and flexibility of using any library or package they choose for a certain task and to organize their project structure as they deem fit.
Express.js is rated over 50,000 stars on its official GitHub repository and has quickly risen to become one of the most popular backend frameworks for building MVC- and API-based applications using Node.js.
Restify is an awesome REST API-first framework for Node.js that borrows heavily from Express.js. What this means is that while Express.js aims to serve both visual web browsers as well as APIs by bringing functionalities such as rendering and templating, Restify doesn’t because it was created mainly for designing and building strict API services that are conveniently maintainable and debuggable.
Netflix, Pinterest, and npm are a few examples of top companies using Restify to power some of their infrastructures, and with almost 10,000 stars on GitHub since its creation in 2011, it looks like Restify is here to stay.
Flask is a WSGI framework that helps users start building web applications using Python and allows them to scale to more complex applications. Flask, when compared with Django (its closely related counterpart) is lightweight and proves to be un-opinionated as it does not enforce dependencies or the layout of a project. Instead, it merely provides suggestions for best practices. It has 52,000 stars (surpassing Rails by about 5,000 stars) on GitHub, and Flask’s popularity has risen since its initial creation in 2004 by Armin Ronacher of Pocoo, an enthusiastic group of Python developers.
Yii (an acronym for “Yes It Is” ) framework is an object-oriented framework PHP that proves to be fast, elegant, and secure in the development of web applications using the MVC pattern.
Yii works with a component-based architecture with solid caching support and is suitable for building various web applications ranging from ecommerce, CRMs, portals, RESTful APIs, and much more. A major factor that endears developers to Yii is its web-based code scaffolding mechanism called Gii. Yii handles repetitive tasks like code generation for models, forms, modules, and CRUD resources using Gii.
Koa is designed by the team behind Express.js. It “aims to be a smaller, more expressive, and more robust foundation for web applications and APIs,” according to its website. This web framework leverages async functions, allowing users to ditch callbacks and improve error handling. It doesn’t bundle any middleware and it “provides a suite of methods that make writing servers simple, fast, and enjoyable.”
Since its first publication on npm in 2013, Koa has had over 30,000 developers star its official GitHub repository, about 20,000 short of its predecessor, Express.js.
ASP.NET MVC is an open-source framework from Microsoft that combines the best features from ASP.NET with the immense benefits of the MVC architecture. It enables you to create clean model classes that can easily be bound to your database. With ASP.NET, developers declaratively define validation rules, using C# attributes, which are then applied on the client and server.
ASP.NET offers support for many database engines like MySQL, SQLite, SQL Server, PostgreSQL, etc., as well as including non-relational stores like MongoDB, Redis, Azure Cosmos DB, and more. ASP.NET is a wonderful alternative to Ruby on Rails if you want to explore something Windows-based yet incredibly fast.
AdonisJs is a Node.js framework that aims to make backend development simple. Adonis ships with an ORM called Lucid ORM that makes writing database related queries relatively easy.
If you have any experience with Laravel, chances are high that you’ll notice a huge similarity in both of these MVC frameworks. Adonis is inspired by Laravel. This is easily seen in its emulation of Laravel’s dependency injection principles as well as in its folder structure, which aims to help make development smoother and more maintainable. Adonis currently has amassed over 8,000 stars on GitHub since its creation in 2015.
Ruby on Rails is immensely powerful and efficient, but there are also many alternatives for you to try if you’d like to be familiar with other frameworks. Which of these Ruby on Rails alternatives have you used?
Install LogRocket via npm or script tag. LogRocket.init()
must be called client-side, not
server-side
$ npm i --save logrocket // Code: import LogRocket from 'logrocket'; LogRocket.init('app/id');
// Add to your HTML: <script src="https://cdn.lr-ingest.com/LogRocket.min.js"></script> <script>window.LogRocket && window.LogRocket.init('app/id');</script>
Would you be interested in joining LogRocket's developer community?
Join LogRocket’s Content Advisory Board. You’ll help inform the type of content we create and get access to exclusive meetups, social accreditation, and swag.
Sign up nowCompare Prisma and Drizzle ORMs to learn their differences, strengths, and weaknesses for data access and migrations.
It’s easy for devs to default to JavaScript to fix every problem. Let’s use the RoLP to find simpler alternatives with HTML and CSS.
Learn how to manage memory leaks in Rust, avoid unsafe behavior, and use tools like weak references to ensure efficient programs.
Bypass anti-bot measures in Node.js with curl-impersonate. Learn how it mimics browsers to overcome bot detection for web scraping.
2 Replies to "11 alternative frameworks to Ruby on Rails"
With Ruby, I would use Roda instead of Sinatra any time soon. It’s way faster, has excellent plugins & support. Paired with Sequel, from same author and Rodauth, it’s a solid solution.
If you’re looking for something fully featured like Rails, NestJS is a good option.