# exAspArk/batch-loader

:zap: Powerful tool for avoiding N+1 DB or HTTP queries

Repository: https://github.com/exAspArk/batch-loader
Canonical: https://ross.abutalabs.com/products/batch-loader
Homepage: https://engineering.universe.com/batching-a-powerful-way-to-solve-n-1-queries-every-rubyist-should-know-24e20c6e7b94
Language: Ruby
License: MIT
License Family: permissive
Topics: n-plus-1, batching, ruby, gem, graphql, graphql-ruby, dataloader, nplus1
Last push: 2025-12-09T20:27:09+00:00

## Health v2 (maintenance only)
Score: 57/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 56, release rhythm 35, longevity 100
- inputs: {"age_days": 3320, "days_push": 267, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1123, forks 51 (observed 2026-08-28T04:03:40.429173+00:00)

## What it is
A Ruby gem providing a generic lazy batching mechanism to avoid N+1 database or HTTP queries, inspired by Facebook's DataLoader and Haskell Haxl. It batches and caches data loads lazily wherever they are needed, with thread-safe loaders.

## Use cases
- avoid N+1 database queries in a Rails app
- batch HTTP requests in a RESTful API
- resolve GraphQL fields efficiently with graphql-ruby
- cache previously loaded records with an identity map
- batch-load data lazily in a multi-threaded Ruby service

## When to choose
- you have N+1 query problems in Ruby code or GraphQL resolvers
- you want a generic, framework-agnostic batching utility
- you need lazy, thread-safe batch loading with automatic caching

## When to avoid
- you are not working in Ruby
- your data access is already efficiently batched by your ORM or framework
- you need eager preloading rather than lazy on-demand batching

## Facets
- artifact type: library
- maturity: stable
- function: caching, middleware, developer-tools
- domain: web-development, backend, databases, apis, performance
- platform: ruby
- tags: dataloader, n-plus-one, batching, graphql, lazy-loading, ruby-gem

## Member repositories
- exAspArk/batch-loader (main) score 57

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:40.429173+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:40:51.959046+00:00, confidence not recorded.
  - readme: https://github.com/exAspArk/batch-loader (fetched 2026-08-28T04:03:40.429173+00:00, sha 550db4c84c5f)
- Data as of 2026-08-30T08:39:29.467469+00:00.
