Writing
Practical field notes on Ruby on Rails, PostgreSQL, performance, and building useful software.
Written from hands-on work: what changed, why it mattered, and how to apply it.
All writing
Newest firstAI Coding Agents for Ruby on Rails: Benchmarks and Best Practices
AI coding agents can inspect a Rails repository, edit several files, run tests, interpret failures, and revise their work. That makes them more useful than autocomplete, but it …
How to Benchmark a Rails Performance Fix
When I optimize a slow Rails endpoint, I create a small profile_compare script for that specific workload. The script does six things: runs the slow request against a known …
Using speedscope.app to Profile Ruby and Rails
A request that takes 900 ms tells us that something is slow, but not where the time went. A call-stack profiler supplies the missing data, and speedscope turns that data into an …
How to Fix N+1 Queries in Rails: Patterns From Six Real Pull Requests
You know what an N+1 query is: one query to fetch a collection of users, then one more query per user to fetch their posts. That’s the tutorial version, and it’s what …
You Don't Need Complex AI Research Agents, It Can Be Implemented As a Skill Most of The Time
When people build an AI research product, the first architectural decision is often which agent framework to use. That decision quickly leads to more decisions: how to run the …
Navigating the Maze: How to Start Working on a Legacy Rails Codebase
Working on a legacy Rails codebase can be challenging. But you can start navigating and working on it effectively with a good strategy. This blog post discusses common steps when …
Rails 8 Authentication Generator With User Registration
Rails 8 includes an authentication generator, so a new application no longer needs a gem just to implement email-and-password sign-in. The generator provides sign-in, sign-out, …
How to Add PostgreSQL Index based on Query Plan as a Rails Developer
As Rails developers, we often focus on writing clean, efficient Ruby code. However, as the application grows optimizing database performance is equally crucial for creating …
Understanding The Output of EXPLAIN As a Rails Developer
Rails Active Record is a powerful ORM that simplifies database operations, but complex queries can sometimes lead to performance issues. We can use EXPLAIN to find out details …
Cheat Sheet for Rails + PostgreSQL Count Performance
The convenience and power of Active Record allows you to interact with your database in a more Ruby-like way, making it easier to write efficient and readable code. However, as …
Building Custom Generators in Rails
In Ruby on Rails, A generator is a tool that helps create scaffolding (basic code structure). By default, Rails provides several built-in generators like rails generate scaffold, …
Let's Start Using Rails Attributes Api
When building applications in Ruby on Rails, We store data in Plain Old Ruby Object (called PORO) value objects. This is a common pattern, We store data directly in service objects …
Using ActiveRecord Strict Loading to explicitly prevent N+1
Active Record strict loading is an awesome feature in Rails that can significantly improve your application’s performance by preventing N+1 queries. In the past days before …