# graph-gophers/dataloader

Implementation of Facebook's DataLoader in Golang

Repository: https://github.com/graph-gophers/dataloader
Canonical: https://ross.abutalabs.com/products/graph-gophers-dataloader
Language: Go
License: MIT
License Family: permissive
Topics: dataloader, facebook-dataloader, golang, graphql, cache
Last push: 2026-05-27T11:03:46+00:00

## Health v2 (maintenance only)
Score: 80/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 84, release rhythm 62, longevity 100
- inputs: {"age_days": 3570, "days_push": 98, "days_rel": 98, "gap_med": 129.5, "n_releases_24m": 3}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1310, forks 78 (observed 2026-08-28T04:04:19.970144+00:00)

## What it is
A Go implementation of Facebook's DataLoader pattern for batching and caching data fetches, commonly used to avoid N+1 query problems in GraphQL servers. It provides batched loading with thunks and a pluggable, request-scoped in-memory cache.

## Use cases
- batch database queries to avoid N+1 problems in a GraphQL API
- deduplicate and cache per-request data lookups in Go
- batch fetch users by IDs in a single round trip
- implement Facebook's DataLoader pattern in a Go backend
- reduce load on a backend service by coalescing concurrent key lookups

## When to choose
- you're building a GraphQL server in Go and need batching/caching of resolvers' data fetches
- you have many concurrent lookups by key that can be coalesced into batched calls
- you want a request-scoped loader with a pluggable cache interface

## When to avoid
- you need a long-lived process-wide cache - the built-in cache is intended only for short-lived loaders
- your project isn't in Go
- you don't have N+1 or duplicate-fetch problems and batching adds unnecessary complexity

## Facets
- artifact type: library
- maturity: active
- function: caching, middleware
- domain: databases, web-development, developer-tools
- platform: go
- tags: dataloader, batching, graphql, request-scoped-cache, thunk

## Member repositories
- graph-gophers/dataloader (main) score 80

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:19.970144+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-30T04:49:55.266819+00:00, confidence not recorded.
  - readme: https://github.com/graph-gophers/dataloader (fetched 2026-08-28T04:04:19.970144+00:00, sha 8c211fcd13a6)
- Data as of 2026-08-30T08:39:29.467469+00:00.
