A collection of my articles on technology, engineering, and products.
What’s scarier than meta-programming? Thread-safe meta-programming!
Lazy attributes are absent from Ruby, but a bit of creativity enables them to be programmed into the language.
A summary of work I did in 2022, and my plans for 2023.
Elixir pipelines are an elegant construct for sequencing operations in a readable way. Fortunately, 9 lines is all it takes to implement them in Ruby.
The way API clients signal results and errors is critical to integration quality, especially for under-documented APIs.
Calling third-party APIs is associated with inherent complexity that’s not going to disappear. It needs to be tamed and confined.
Estimates – love them or hate them, sometimes you need them. This article outlines a simple yet effective estimation method I use for client projects.
Databases use sophisticated planning algorithms to determine best query execution strategy. An important aspect is deciding which indexes, if any, to use. This article explores why some indexes could be replaced by other existing indexes and how to identify them.
Foreign keys are essential to all non-trivial database schemas, yet their performance aspects are often overlooked. In this article, we’ll shed more light on the subject.
Deletion timestamps are often used to implement soft-deletion by marking rows deleted without actually discarding them. While simple, this approach has consequences for index performance. Let’s understand the problem and how partial indexes help to to solve it.
Sooner or later every project will need to migrate production data, not only the schema. There are many different approaches in the wild – most of them overly complex. In this article we’ll tackle the problem using vanilla Rails.
User authentication in Rails is a solved problem but how can we protect individual resources with a password? It turns out that all we need is vanilla Rails and not that much code.
Global state can easily lead to interference between test cases and cause random failures. In this article, we’ll discuss a technique for alleviating this problem when reducing the global state is infeasible.
Copying a file in a file manager results in adding a copy counter to the file name. In this article, we’ll devise a simple and elegant algorithm based on
Enumerator for doing the same in a Rails app.
Rails is known for many things but memory effectiveness is not one of them. By default, it loads all gems, used and unused, which contributes to the overall memory footprint. Fortunately, we can easily eliminate this waste without touching the app.
Single-page apps are all the rage nowadays. Many praise their vague technical benefits while ignoring tremendous development costs.
The larger the test suite the slower it gets. This is an obvious yet annying truth. In this article, I present a simple and generic technique for improving test suite performance (almost five-fold in my case) without touching the code base at all.
Copyright © 2019-2023 Greg Navis. All rights reserved.