-
Attentive reader could notice that in every described case, it was a requirement to explicitly list data that we want to preload for a group of users. Gladly, there is a simple solution! ArLazyPreload will make N+1 disappear just by enabling it. As soon as you need to load association for any record, it will load it once for all records that were fetched along this one. And it works with ActiveRecord and N1Loader perfectly!
-
InfluxDB
InfluxDB – Built for High-Performance Time Series Workloads. InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
-
It's worth mentioning counter_culture alternative that has many features compared with the built-in counter_cache
-
Unfortunately, such associations are not possible to preload with includes. Gladly, there is a solution with N1Loader.
-
DatabaseConsistency
The tool to avoid various issues due to inconsistencies and inefficiencies between a database schema and application models.
Described issues may be found with DatabaseConsistency.
-
Thank you for sharing this with me! It seems that https://github.com/salsify/goldiloader gem does the same as https://github.com/DmitryTsepelev/ar_lazy_preload. It would be great to compare both solutions.
-
Stream
Stream - Scalable APIs for Chat, Feeds, Moderation, & Video. Stream helps developers build engaging apps that scale to millions with performant and flexible Chat, Feeds, Moderation, and Video APIs and SDKs powered by a global edge network and enterprise-grade infrastructure.
Related posts
-
A newbie's look at N+1 queries
-
BasedUUID: URL-friendly, Base32-encoded UUIDs for Rails models
-
N1Loader is alive as ever Enhance your GraphQL API by getting rid of N+1 issues
-
Best rails tools to automatically handle logging of things like all a user's actions, or changes to a record in a module - primarily for audit purposes.
-
Uniqueness validation does not work since the beginning of Ruby on Rails.