Abstract: The 18-year-old Ruby on Rails is still active in many companies, but it has also been questioned. The author of this article will analyze the advantages and disadvantages of Ruby on Rails and its suitable usage scenarios, and talk about why we will Still using Ruby on Rails?
Original link: https://ift.tt/ICpAZLJ
Disclaimer: This article is translated by CSDN, and reprinting is prohibited without permission.
Author | Liubov Derevianko
Translator | Crescent Moon Editor | Zheng Liyuan
Produced | CSDN (ID: CSDNnews)
As 2023 approaches, Ruby on Rails is becoming a more mature technology. Even though it’s been 18 years since it was first released, many people are still using Ruby on Rails, the one-time savior of Web application development. However, more and more people are starting to question its popularity. Therefore, in this article, we will answer the following questions:
-
Is Ruby on Rails still alive?
-
Why are we still using Ruby on Rails in 2023?
-
When should we use Ruby on Rails, and when should we use a more competitive technology?
Is Ruby alive in 2023?
In September 2022, Rails 7.0.4, 6.1.7, and 6.0.6 will be released. These releases include bug fixes, performance improvements, and other enhancements. A year ago, the first alpha release of Rails 7 was released, and we saw an active community successfully turn a series of ideas into action and build a complete technology stack for web development, solving many front-end and back-end pain points . However, these releases are not representative of the reality of software development, so to figure out whether Ruby on Rails is dead or alive, we need to look at the statistics.
Stack Overflow compiled a list of the most popular technologies, with Ruby at number 14, being used by 6.37% of professional developers.
The TIOBE Index is an important measure of programming language popularity, taking into account not only software developers, but also third-party vendors and courses related to specific technologies. According to the TIOBE Index for November 2022, Ruby ranks as the 20th most used programming language.
Statistics prove that among all the choices in the market, Ruby on Rails is still a non-negligible presence. Although Ruby is obsolete, that doesn’t take away from the convenience that Ruby on Rails brings to solving business problems, it is still a minimum viable product, content management system, dynamic website, e-commerce solution, reservation system, social network and other The core technology of the application. However, the competition between technologies is intensifying and there are many criteria we should consider when choosing a technology stack for a product. Despite Ruby’s performance and scalability improvements, many world-renowned companies still use Ruby in their applications.
Big companies still using Ruby
Github
With support for C, Shell, Ruby, and MySQL, Github has become the go-to place for software developers to host their source code. The number of companies using Github has reached 1.8 million, including both well-known enterprises and startups. However, many projects on Github still use Ruby (see: https://ift.tt/DykLIWx).
Airbnb
What sets Airbnb apart from its competitors is its functionality, not its technology stack. Their service represents an online marketplace that helps users find suitable places to stay while travelling, or helps businesses solicit guests. As of fall 2022, Airbnb has expanded to 191 countries and territories, but their tech stack of choice for web development still includes Ruby on Rails because the framework helps them manage bookings efficiently despite the influx of data and transactions.
Shopify
As a leading e-commerce company, Shopify has been in the spotlight since its founding in 2006. Today, the platform accommodates online selling businesses of all sizes. Shopify’s technology stack includes dozens of technical solutions and components, but Ruby remains at the heart of the platform because of its flexibility and efficient operations management.
Dribble
Dribble A social networking platform for designers where they can share and find mockups and animations, hire other designers, or get feedback on their work. The platform has been powered by Ruby on Rails since 2009 and is still popular today. Also, there are a lot of Dribble clones on the web using the same technology stack.
Ernst & Young
According to statistics from Statista, Ernst & Young currently has 359,449 employees, and its service network covers Europe, the Middle East, the Americas and other regions. EY is still using Ruby on Rails today and plays a vital role in its complex architecture.
In addition, many companies are also using Ruby on Rails, such as Groupon, Coinbase, Gitlab, Zendesk, Etsy, Crunchbase, Ask.fm, Fab, etc., these well-known companies have adopted Ruby on Rails, and also Using Go, Python, Java, etc. as a supplement to the technology stack.
Ruby on Rails or not, that is the question
In order to choose the right technology stack, you first need to figure out the functional requirements and non-functional requirements of the product, as well as the risks that may be encountered during the development process. Next, we’ll look at the pros and cons of Ruby on Rails, and then discuss why there’s so much debate about whether Ruby is still alive.
Over the years, Ruby on Rails has received a lot of criticism due to performance and scalability issues. Compared to C++, Golang or other programming technologies, Ruby’s performance is really not as good as it should be: it takes more time to execute the code, and the difference can be felt especially in large high-load projects. Although Ruby is slower, Rails application optimizations can improve performance issues. It turns out that Ruby on Rails requires special attention to issues such as caching, avoiding excessive memory consumption, and scaling efficiently.
So, is Ruby on Rails really not scalable enough? Shopify’s ability to support more than 500,000 businesses simultaneously is a testament to the scalability of Ruby on Rails. So, if you have the right team behind the software development, you can guarantee the scalability of Ruby on Rails even at a low cost.
To ensure the scalability of Ruby on Rails, the development team needed to simplify the code, apply a modular approach, and save the state of the application to the client. However, the complexity of scaling depends on the architecture, and choosing the right architecture from scratch can greatly simplify future scaling. Therefore, companies need to be more careful not to lose sight of the ecosystem of solutions, while keeping in mind the potential influx of user requests. Next, let’s briefly describe the pros and cons of Ruby on Rails to help you decide how to choose a framework for product development.
Ruby pros and cons
Next, let’s look at Ruby’s shortcomings and suggest ways to address them. Looking at all the bad reviews for Ruby on Rails, the most common complaints people make include:
-
Slowness and performance issues (above we have covered how to deal with these issues by optimizing Ruby on Rails applications);
-
Decline in popularity (Finding experienced Ruby on Rails developers is a daunting challenge due to the steep learning curve for Ruby. However, Ruby on Rails’ decline in popularity is driven by competing technologies like Lavarel, Django, and Node.js caused by continuous development).
Although the shortcomings of Ruby on Rails are due to historical reasons, thousands of companies around the world still use it as their primary technology.
Why do these companies still favor Ruby on Rails? Below, we describe five key advantages of Ruby on Rails.
1. Speed up development
The development speed of a product with Ruby on Rails at its core is astounding, because Ruby on Rails has a clean syntax and provides out-of-the-box solutions, so-called “gems”. For startups and MVP development, where time is at a premium and a single misstep or any delay can lead to failure, Ruby on Rails is a strategic choice. Still others are using Ruby on Rails to build products from the ground up or enhance their solutions.
2. High security
Enterprises are always faced with security breaches and phishing problems. Cybersecurity breaches can tarnish a company’s image and cause property damage, so choosing the right technology is critical. By choosing Ruby on Rails, you can minimize the risks associated with cross-site scripting, cross-site request forgery, SQL injection, and clickjacking, provided of course you have a mature team capable of securing your Ruby on Rails application.
3. Easy to use
Because of the simplicity and clarity of Ruby on Rails’ syntax, programmers can solve complex tasks with only a small amount of code. According to the Rails Doctrine, Ruby on Rails places great emphasis on programmer happiness. A clear syntax allows developers to switch between multiple projects without lengthy onboarding. Therefore, the biggest advantage of Ruby on Rails is convenience, and the simplicity of developing and maintaining code.
4. Strong and Cohesive Community
The community has developed around Ruby on Rails, continually improving the framework. Its core team consists of a group of contributors who have been working on improving Rails since 2003. More than 6,000 engineers have contributed to Ruby on Rails, helping Ruby steadily solve problems, add new features, and accelerate releases. It is because of such a strong community that Ruby on Rails has grown into a mature technology, so developers can easily find help or answers to their questions through various courses, forums, or other materials when solving complex problems .
5. Easily implement business logic and be compatible with other technologies
Ruby on Rails is a full-stack framework with controllers and modules that enable developers to implement the complex business logic that underpins web applications. APIs and gems contribute a lot to this. Also, adding a front-end framework and integrating it with Ruby on Rails doesn’t take too much effort.
When to use Ruby?
As a technology, Ruby can play a strong role in the following areas:
-
Web applications (especially for startups or developing minimum viable products);
-
Back-end development of mobile applications (Mobile development generally chooses Java, Kotlin or Swift, but in fact Ruby can also effectively support these back-end development);
-
E-commerce products (Ruby can be used not only to build online stores, but also supports other modules, from customer relationship management and payment tools to inventory and marketing components);
-
Static site generators (these generators can apply templates to raw data to generate static HTML sites, Ruby can be used as their core technology, Jekyll released 14 years ago took this approach);
-
Automation and DevOps (you can automate application installation and configuration with Ruby, Heroku, Vagrant, Chef, and Puppet are great automation and DevOps tools);
-
Web servers (developers often use Ruby to handle requests);
-
Data processing (although the typical developer will use Python to parse, analyze and store data, if you need to clean, transform and validate data, you can consider Ruby);
-
Web scraping (you can take advantage of Ruby to perform complex research and analysis, and use it to extract and parse information).
Whether you’re planning to build a social networking app, fintech software, or an edtech platform, security is a top consideration, and as mentioned above, security is a key strength of Ruby, so either can be considered.
Security in Ruby on Rails
It turns out that Ruby on Rails is very good at defending against attacks and maintaining security. To protect against cross-site scripting, we need to screen for potentially malicious components that execute automatically. Ruby on Rails takes a different approach to eliminating risk. For example, mark each line with the flag html_safe (output without flags set will be filtered by Rails). Or use special code structures to ensure safe output of data.
For cross-site requests, Ruby on Rails can use token authentication to deal with such attacks. Additionally, there are corresponding security advisories for POST and DELETE queries.
One of the vulnerabilities in Ruby on Rails is caused by the mass assignment feature, which allows an attacker to change values in the database and create new records in tables. But an experienced Ruby on Rails developer can easily minimize the risk in this situation.
However, no matter what measures are taken by the environment and syntax of Ruby on Rails, whether your web application is an online store, static site generator or other products developed with Ruby, only the development team is aware of the potential risks. and take appropriate measures to protect them. Although Ruby on Rails has high security and other advantages, you should compare Django, Laravel, Node.js and other competing technologies horizontally and choose the appropriate technology stack according to your needs.
Ruby and other alternative technologies
After the release of Hotwire, Ruby became available for full-stack web development. Today, we see more and more web applications being developed full-stack in Ruby. However, when it comes to full-stack development, Ruby has no shortage of competitors.
RUBY/RAILS and JAVASCRIPT/NODE.JS
From a performance point of view, JavaScript is more powerful than Ruby. JavaScript is the best choice for low-latency applications because it supports asynchronous processing, so clients don’t have to wait for functions to execute. And Ruby is an interpreted language, which is interpreted at runtime and the particularity of CPU processing, which makes Ruby seem not as powerful as JavaScript.
Both the Ruby and JavaScript communities are strong and diverse. JavaScript developers are free to use modules and packages, and Ruby developers are free to use gems. However, I think the Ruby community is more user-friendly, with regular meetups, conferences, and podcasts. When it comes to programming language-related security vulnerabilities, JavaScript has more, especially on the client side. In terms of cost, neither technology is very attractive, but Ruby can be the best tool for building minimum viable products. JavaScript, on the other hand, is in very high demand and has been voted the most used programming language by the Stack Overflow community for ten consecutive years.
Node.js is a JavaScript runtime environment that allows us to write server-side code using JavaScript. You can share code with the browser and the backend through Node.js, and handle different operations at the same time. Therefore, Node.js is more suitable for real-time applications, such as sending messages, chat software, online games, etc.
In terms of security, Node.js is inferior to Ruby because npm packages may contain undetected vulnerabilities. Although Node.js has better performance, Ruby can still be used to solve the following tasks:
-
Full Stack Web Application Development
-
E-commerce project
-
prototyping
-
web scraping
-
Social network
RUBY/RAILS and PHP/LARAVEL
PHP has been used in Web development for 25 years as a general-purpose scripting language. A surprising number of frameworks and libraries make it a flexible programming language with a large community. In 2011, Taylor Otwell released Laravel, a PHP framework that can be used for web development tasks such as authentication, routing, sessions, and caching. So how should we choose between PHP and Ruby and its frameworks?
From a performance standpoint, PHP is superior to Ruby. But compared to Laravel, the development speed of Ruby on Rails is far ahead. The core principles of the two frameworks are largely very similar. Laravel is widely used in enterprise applications, while Ruby has a wider and stronger community.
RUBY/RAILS and PYTHON/DJANGO
Python is a general-purpose programming language whose popularity has skyrocketed ever since artificial intelligence entered a new phase of development. Born 31 years ago, Python has become an indispensable technology for building algorithms for machine learning models. But when comparing Ruby and Python, we should note the following key differences:
-
Ruby is functional programming, suitable for web development, while Python has found applications in different branches of AI as well as academia.
-
Ruby is a 100% object-oriented programming language, while Python implements only part of it.
-
The two declare variables and use variables in different ways.
Django is a backend development framework for Python. Unlike Ruby on Rails, it does not support full-stack development. Performance-wise, the two frameworks are mostly similar. At the same time, the communities of both Python and Ruby are very strong.
Why is Ruby a great fit for startups?
Startups choosing Ruby on Rails to develop their products will never cause delays. Ruby on Rails is great for developing minimum viable products, iterating quickly, and scaling products. Businesses can gain a foothold quickly with the help of Ruby on Rails, and for startups where timing is key to success, Ruby on Rails is ideal.
Some well-known startups have adopted Ruby:
-
Stripes
-
Github
-
Figma
-
Airbnb
-
Shopify
-
Fiverr
-
Trivago
Not only did these startups find instant success with Ruby, but they also managed to scale and transform their technology stacks. Also, because of Ruby’s maturity and stability, developers love using it to create products from scratch.
Next, let’s look at some real cases and projects that use Ruby to develop products.
Ruby on Rails Case Study 1: Cloud Provider Application
This is a top-notch public cloud service, and you can get support from a dedicated team by phone or email.
Many public cloud services lack such intimate support, or need to pay expensive fees to enjoy such services. Most of the time, you’re left to fend for yourself.
This cloud service offers high scalability, security, fast cloud-based deployment, data integrity and, most importantly, personal support.
The system was created using the latest technologies and versions such as Rails 7, Hotwire, PostgreSQL and Sidekiq, providing customers with a web interface to create different clouds and paying accordingly. Additionally, it provides a user-friendly admin panel that helps us manage invoices, clients, etc.
Ruby on Rails Case Study 2: Social Networking Application
Large-scale social networking applications aim to facilitate communication between people through technology. Social networks have changed our lives, and this project amplifies the positives of large social networks and compensates for the negatives.
This project brings out the best innovative UI practices and user experience in the social networking industry. Key features include:
-
Registration/login/user profile pages with custom settings;
-
Public and private posting functions;
-
Comment;
-
Complex user headline information, providing a large number of functions;
-
live chat;
-
geolocation and maps;
-
Invite function.
The techniques they use are as follows:
-
Native iOS: Swift, Combine, CoreData, NetworkFramework, Alamofire;
-
Native Android: Kotlin, Dagger 2, Litho, RxJava;
-
Ruby backends: Ruby/Ruby on Rails, PostgreSQL, Redis, Docker, Kubernetes.
Ruby on Rails Case Study 3: Office Space Booking Application
This web application manages and reserves desks and conference rooms. The technology stacks involved mainly include: Rails 7, Hotwire, Stimulus, Dry-monads, Sidekiq, Adminstrate, Oauth, etc.
core function
Users can manage the booking and scheduling of spaces. Authorized users can select desks and book times. The system can be used to manage any facility in the company, including lounges or other rooms.
Users can see which colleagues are in the office, so they can easily coordinate space usage.
The app shows usage of all spaces through a single dashboard, and it also provides control over who has access to specific spaces and when.
Additionally, the app offers a feature that allows users to choose to occupy an entire meeting room for a period of time via the calendar. Users can view and manage booked hours by day, week or month. Users can search for meeting rooms and filter by location, capacity and facilities. As a result, people can always find the right space and make the most of the meeting room.
Users can also leave feedback if the furniture in the room is broken or some tools are missing. Armed with this information, office administrators can address the issues based on feedback.
Standard process for Ruby development projects
The following is the standard process we use to develop projects in Ruby, for reference only:
1. Check all inputs/documents/designs provided by customer.
2. Break down the project and estimate hours for each subsection.
3. Determine the key parts of the project, possible risks, and work priorities.
4. Create a technical vision for the project (proposed architectural design and technology stack).
5. Detailed labor estimates for each part of the project, including details, comments, questions and a list of suggestions.
6. Prepare some demo projects to show examples, then you can use Ruby on Rails.
7. Update the final estimate and develop a time plan and strategy for the project.
8. Development stage.
9. Consult with customers about future development features and timelines.
10. Conduct regular security and code quality reviews.
The text and pictures in this article are from CSDN
This article is transferred from https://www.techug.com/post/why-will-we-use-ruby-on-rails-by-20238727fd014e73be436c81/
This site is only for collection, and the copyright belongs to the original author.