Index
- Backend
- Dependency reduction with ‘Solid’ adapters
- Modernised resource pipeline with Propshaft
- Improvements in Active Record
- Enhanced support for SQLite in production
- Integrated authentication system
- Dockerfile management improvements
- Frontend
- Stimulus and Turbo enhancements
- Deployment
- Simplified deployment with Kamal 2 and Thruster
- Conclusion
Ruby on Rails has always been a central technology in our development stack. Thanks to its elegant syntax, convention over configuration philosophy and rich ecosystem of gems, Rails has enabled us to realise numerous projects quickly and efficiently. Whether for complex web applications, scalable APIs or SaaS solutions, this framework has proven to be a reliable and productive choice.
Version 8 of Ruby on Rails was released on 8 November 2024, introducing a number of significant improvements in terms of performance, distribution and modern development. This article will explore the main new features of the release and their impact on the way we develop web applications.
Backend
Dependency reduction with ‘Solid’ adapters
- Solid Cable replaces Redis as the server for WebSocket management, using a fast polling system that guarantees Redis-like performance when used with SQLite on the same server. It also retains messages for one day, facilitating debugging.
- Solid Cache substitutes Redis or Memcached for caching HTML fragments, using disk instead of RAM. Thus, it provides a larger and more durable cache, with options for encryption and data retention management, facilitating compliance with privacy regulations.
- Solid Queue enables job queues to be managed directly in the database, eliminating the need for external services such as Redis. Therefore, it simplifies the application infrastructure and reduces the dependency on external tools.
Modernised resource pipeline with Propshaft
Improvements in Active Record
Enhanced support for SQLite in production
Integrated authentication system
Dockerfile management improvements
Frontend
Stimulus and Turbo enhancements
Stimulus, the minimal JavaScript framework for Rails, has been enhanced with new APIs that make it even easier to handle events and control the DOM. Now, developers can exploit more efficient bindings, improving application interactivity without having to resort to heavier frameworks such as React or Vue.
Turbo has received significant improvements, making page loading even faster and optimising dynamic navigation. Turbo Frames and Turbo Streams have been refined to improve partial page refreshes, reducing the number of requests to the server and improving the overall performance of web applications.
These improvements enable the development of more responsive and fluid interfaces, keeping the use of customised JavaScript to a minimum and reducing the complexity of frontend code.
Deployment
Simplified deployment with Kamal 2 and Thruster
Moreover, Rails 8 includes an optimised Dockerfile that incorporates Thruster, Rails 8 also includes an optimised Dockerfile that uses Thruster, a proxy that works in front of the Puma web server. Thruster improves performance through X-Sendfile, caching and asset compression, eliminating the need for additional web servers such as Nginx. As a result, the standard Rails container can receive traffic immediately.
Next, Kamal 2 introduces Kamal Proxy, a customised proxy that replaces alternatives such as Traefik. Kamal Proxy ensures seamless updates, automatic SSL certificates with Let's Encrypt and support for multiple applications on one server without complicated configurations.