A Small AWS Mistake That Taught Me to Always Check the Region

A while back, when I was just starting to get more hands-on with AWS and infrastructure, I ran into a performance issue that took me longer than I’d like to admit to figure out. At the time, we were upgrading one of our Rails applications to a newer version. Instead of upgrading the existing EC2 instance, we decided to provision a new one and deploy the application there. It felt like the safer approach since we could leave the old server untouched until we were confident everything was working as expected. ...

April 12, 2026 · Mausam Pun

Solving the N+1 Query Problem in Rails

One of the first performance issues I learned to look for in Rails applications is the N+1 query problem. It’s surprisingly easy to introduce. The code usually looks clean, everything works as expected, and during development you probably won’t notice anything wrong. Then the application starts getting more data. Pages become slower, API responses take longer, and the database suddenly starts doing a lot more work than it needs to. ...

January 21, 2026 · Mausam Pun

Automating Tailwind Builds with Kamal Post-Deploy Hooks

I was recently working on a small Sinatra application that used Tailwind CSS for a few internal pages. The application itself was deployed using Kamal, and the deployment process was pretty smooth. The only annoying part was that after every deployment, I had to SSH into the server and run: bundle exec rake tailwind:build It isn’t a difficult command to run. The problem is remembering to run it. After forgetting a couple of times and wondering why my UI changes weren’t showing up, I figured this was exactly the kind of repetitive task that should be automated. ...

January 5, 2026 · Mausam Pun

Setting Up CI for a Multi-Database Rails App When One Database Is Read-Only

I was working on a Rails application that used two PostgreSQL databases. The primary database was owned by our application, so we could create it, run migrations, and modify the schema whenever we needed to. The second database was different. It belonged to another application, and our application only connected to it for reading data. We didn’t own its schema, and we weren’t responsible for running migrations against it. Everything worked perfectly on my local machine, so I didn’t think much about it. ...

December 19, 2025 · Mausam Pun

How Caching Helped Us Avoid Slack API Rate Limits

I was working on a Rails application that integrated with Slack. The integration had two main responsibilities. The first was allowing users to map their Slack accounts with their profiles in our application. The second was sending notifications to users or channels whenever certain events occurred. Everything worked well while we were developing locally, but once the application reached staging and production, we started seeing an issue that hadn’t shown up before. ...

October 23, 2025 · Mausam Pun