# sfackler/r2d2

A generic connection pool for Rust

Repository: https://github.com/sfackler/r2d2
Canonical: https://ross.abutalabs.com/products/r2d2
Language: Rust
License: Apache-2.0
License Family: permissive
Last push: 2024-10-10T01:01:52+00:00

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

## Adoption (not part of the score)
Stars 1656, forks 88 (observed 2026-08-28T04:05:18.083190+00:00)

## What it is
r2d2 is a generic connection pool library for Rust that maintains a set of open connections for repeated use. It is backend-agnostic, with adaptor crates for PostgreSQL, Redis, MySQL, SQLite, and many other databases.

## Use cases
- pool database connections in a rust web service
- avoid opening a new connection per request under high traffic
- manage postgres connection pool in rust
- reuse redis connections efficiently
- add connection pooling to diesel or rusqlite
- prevent resource exhaustion from too many open connections

## When to choose
- you need a mature, widely-used connection pool in Rust
- your backend database has an existing r2d2 adaptor crate
- you want backend-agnostic pooling via the ManageConnection trait

## When to avoid
- your database driver already includes built-in pooling (e.g. official mongodb driver)
- you need async connection pooling, where alternatives like deadpool or bb8 may fit better

## Facets
- artifact type: library
- maturity: stable
- function: database, caching, concurrency
- domain: databases, developer-tools, backend
- platform: rust, cross-platform
- tags: connection-pool, rust-library, database-pooling

## Member repositories
- sfackler/r2d2 (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:18.083190+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-30T03:44:50.645460+00:00, confidence not recorded.
  - readme: https://github.com/sfackler/r2d2 (fetched 2026-08-28T04:05:18.083190+00:00, sha 7b1ebce0afca)
  - registry_crates: https://crates.io/api/v1/crates/r2d2 (fetched 2026-08-29T11:17:34.521407+00:00, sha f70a306d5a16)
- Data as of 2026-08-30T08:39:29.467469+00:00.
