Contributions

Article
For the last few months, I’ve been working semi-full-time on my first Rust project. After the first painful weeks of struggling against The Compiler, I feel I’m now spoiled by Rust development experience. In this blog post, I’ll describe improvements to my Ruby workflow that originate from what I’ve seen in the Rust ecosystem.
Article
Caching is an effective way to speed up the performance of Rails applications. However, the costs of an in-memory cache database could become significant for larger-scale apps. In this blog post, I’ll describe optimizing the Rails caching mechanism using the Brotli compression algorithm instead of the default Gzip. I’ll also discuss a more advanced technique of using in-memory caching for extreme performance bottlenecks.
Library
Drop-in enhancement for Rails cache, offering better performance and compression with Brotli algorithm
Tutorial
Improving the performance of a Rails application can be a challenging and time-consuming task. However, there are some config tweaks that are often overlooked but can make a significant difference in response times. In this tutorial, I will focus on a few “quick & easy” fixes that can have an immediate impact on the speed of your Rails app.
Tutorial
Fixing N+1 issues is often the lowest-hanging fruit in optimizing a Rails app performance. However, for non-trivial cases choosing a correct fix could be challenging. Moreover, incorrectly applied eager loading does not work or even worsens response times. In this blog post, I describe tools and techniques I use to simplify resolving N+1 issues.
Tutorial
In theory, configuring eager loading to avoid N+1 issues is straightforward. Chaining includes method is usually enough to ensure that all the relations data is fetched efficiently. However, this rule breaks for some easy-to-overlook edge cases. In this blog post, I'll describe how to eager load ActiveRecord relations using custom SQL ORDER BY sorting.
Tutorial
PostgreSQL database locks usually work seamlessly until they don’t. Before your app’s dataset and traffic reach a certain scale, you’re unlikely to face any locks-related issues. But if your app suddenly slows down to a crawl, deadlocks likely are to blame. In this blog post, I’ll describe how to monitor database locks and propose best practices to prevent them from causing issues.
Tutorial
By default, Rails ActiveRecord executes most of the SQL queries in a non-optimal way. In this blog post, I’ll describe how to fix this issue to speed up bottlenecks and reduce memory usage.
Tutorial
I don’t like to type much. Even minor improvements in your debugging workflow are likely to accumulate into huge keystrokes savings over time. In this blog post, I’ll describe a simple way to add debugging shortcuts to the project without modifying the codebase shared with other team members.
Tutorial
Caching might seem a perfect solution to speed up slow database queries. However, caching in Rails apps can be easily misused, leading to poor maintainability or even slower performance than without it. In this blog post, I'll discuss the common pitfalls of caching SQL queries in Rails apps. I'll also describe my toolkit for assessing the cacheability of database queries and techniques for reducing the cost of caching infrastructure.
Tutorial
What’s the size of user.rb file in your current project? The default Rails way model-view-controller architecture often leads to a bloated model layer. Presenter pattern is one of the more straightforward ways to slim down your Rails models. It also helps to reduce the logic in the view layer and makes testing easier. In this blog post, I’ll describe how to implement a presenter pattern without including additional gem dependencies.
Tutorial
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 interactions. In this tutorial, we’ll deep dive into the intricacies of this new API. We’ll discuss lazy-loaded queries, Ruby threading model, blocking IO, database pool vs. max connections limit, and performance impact of concurrent database clients.
Tutorial
Config variables should never be embedded directly in the codebase. It is a common practice to extract them into a separate configuration layer. A standard approach for Ruby on Rails apps is to use static ENV variables that can only be changed via a release process. In this blog post, I’ll describe the use cases for using dynamic config variables that can be modified on the fly. I’ll also share a simple way to start using them in your app without including additional gem dependencies.
Tutorial
Rails performance audits have been my main occupation and source of income for over a year now. In this blog post, I’ll share a few secrets of my trade. Read on if you want to learn how I approach optimizing an unknown codebase, what tools I use, and which fixes are usually most impactful. You can treat this post as a generalized roadmap for your DIY performance audit with multiple links to more in-depth resources.
Tutorial
Things usually work until they don’t. Sidekiq background job process can explode, quietly turn off, or get stuck for a variety of reasons. Random network errors, misconfigured email clients, shortage of RAM, or disk space on Redis to name a few. Adding a correct monitoring infrastructure can save you a lot of headaches and angry calls from customers. In this blog post, I’ll describe a simple way to monitor the uptime and responsiveness of Sidekiq processes in Rails apps.
Tutorial
I’m not sure if the world needed another post about N+1 queries in Ruby on Rails. To make up for the cliche topic, I’ll describe less common solutions to this problem. Read on if you want to learn how to reduce the number of cascading N+1 SQL queries without using includes or additional table join operations.
Article
Ruby on Rails view partials can help keep your codebase DRY (Don't Repeat Yourself) but misusing them can have a significant performance impact. In this blog post, I'll describe when you should avoid using view partials and the alternatives.
Tutorial
PostgreSQL database queries are a common performance bottleneck for web apps. Before you resort to more complex optimization techniques like caching or read replicas, you should double-check if your database engine is correctly tuned and queries are not underperforming. In this blog post, I present a step by step guide on using PG Extras library to spot and resolve common PostgreSQL database performance issues.
Library
Ruby PostgreSQL database performance insights. Locks, index usage, buffer cache hit ratios, vacuum stats and more.
Library
A simple gem for eliminating Ruby initializers boilerplate code, and providing unified service objects API
Tutorial
Slow database queries are a common performance bottleneck for Ruby on Rails apps. Simplifying a complex query is often not possible due to the underlying business logic. Instead, you can extract parts of a query, cache and reuse them to improve performance. In this tutorial, I’ll describe a range of techniques on how to do it.

We will cover more advanced ActiveRecord and PostgreSQL topics EXPLAIN ANALYZE, and query plan visualizer tool.
Tutorial
HTTP content compression has a significant impact on the client-side performance of a web app. In this blog post, I’ll describe different methods for compressing dynamic and static content in Ruby on Rails apps using Gzip and Brotli algorithms.

We’ll start by describing what exactly is a content compression, measure what’s the overhead compared to potential gains. We’ll also learn how to check if assets are correctly compressed using popular networking tools.
Article
In this tutorial, I’ll describe a couple of non-obvious Ruby on Rails mistakes that could bring down your production system. They are so sneaky that they could get past the review process of even more experienced developers. Please don’t ask me how I know them.
Article
Ruby MRI does not support parallel CPU bound operations due to the dependency on non-thread safe C extensions. Despite that Input/Output operations like HTTP requests, are still a perfectly valid use case for spinning up multiple threads. Read on to learn what tools are available for requests parallelism in Ruby with all their cons and pros.
Tutorial
Inheritance is often frowned upon, because “You wanted a banana but got the whole jungle…“. In some scenarios, it can be a viable alternative to modules composition for sharing behavior. In this tutorial, I will describe a practical use case where using abstract base class pattern plays nicely with the Rails controllers layer.

Read on if you want to find out how to “write Java in Ruby”.
Library
Rails PostgreSQL database performance insights. Locks, index usage, buffer cache hit ratios, vacuum stats and more.
Tutorial
UUID is an alternative primary key type for SQL databases. It offers some non-obvious advantages compared to standard integer-based keys. Rails 6 release fresh out of beta introduces a new feature in ActiveRecord that makes working with UUID primary keys more straightforward. In this tutorial, we will dive deep into UUIDs with all their cons and pros.
Article
My side project Slack app Abot has recently reached a milestone of $10,000 total profit. In this blog post, I describe how the project has changed during the last year and what I am doing to grow and promote it. I also share some details about the usage stats and profit.
Tutorial
Storing sensitive data in plaintext can seriously harm your internet business if an attacker gets hold of the database. Encrypting data is also a GDPR friendly best practice. In this tutorial I will describe a simple way to securely encrypt, store, and decrypt data using built in Ruby on Rails helpers instead of external dependencies.
Tutorial
Continuous integration and delivery pipeline can have a significant impact the dev team’s productivity and stability of production releases. In this tutorial, I describe how to automate testing, security checks, and deployments for Ruby on Rails apps using CircleCI. I cover a basic CI setup as well as more advanced features like concurrent specs, dependencies caching, NodeJS/Webpack setup, Heroku deployments, and GitHub integration.

Showing the last 30 only...