Tutorials

PostgreSQL zero-downtime migration of a primary key from int to bigint (with Ruby on Rails specific notes)
A primary key integer field approaching overflow is a devops nightmare. We explain step by step to how we made the migration with zero downtime.You have an auto increment primary key int field and it’s nearing the maximum value for int: 2,147,483,...

Don't waste your time on assets compilation on Heroku | Arkency Blog
At some point, you may want or be forced to use the CDN to serve assets of your Rails app. When your app is globally available, you may want to serve the assets from strategically located servers around the world to provide the best possible exper...


The In-depth Guide to ActiveRecord load_async in Rails 7
Rails 7 introduces ActiveRecord load_async API that runs SQL queries asynchronously in the background thread. This seemingly simple change of just adding a single new method that takes no arguments has profound implications for database layer inte...

Episode 3: String-Based Templates vs. DSLs: the Pros
In this episode, I break down the main conceptual difference between “string-based templates” such as ERB and “DSLs” such as Papercraft, the various options within each category, and some of the reasons you might want to choose one approach or ano...


Rails adds support for Fiber-safe ActiveRecord ConnectionPools | Saeloun Blog
One of the major focuses for Ruby 3 was parallelism and concurrency. A trailblazer in this space is the use of Ruby Fibers. Fibers are a concurrency mechanism that allows us to pause, loop, and resume execution while consuming far fewer context sw...


Ruby 3.1 adds error highlighting gem | Saeloun Blog
When working with any programming language, developers deal with error stack traces whenever an exception or an error gets raised. The stack trace gracefully points out the error location and provides information about program subroutines.When it ...