4 ms·
IME the Rails ecosystem and community pushes teams into architectural decisions that don't scale quite well. In small apps it's easy to keep track of the numbe
by whstl 2y ago
IME the Rails ecosystem and community pushes teams into architectural decisions that don't scale quite well.
In small apps it's easy to keep track of the number of queries going to the DB per http request and their cost, but with bigger apps what I often find is ActiveRecord, services, policies, all calling the database way too much and too often.
Monitoring which individual queries are slow is easy, but it doesn't help if operations are overcomplicated. Even if you chase all obvious N+1s, you might still have "sets of queries that could have been joins" but are in different classes, so it's difficult to notice.