# stuartsierra/component

Managed lifecycle of stateful objects in Clojure

Repository: https://github.com/stuartsierra/component
Canonical: https://ross.abutalabs.com/products/stuartsierra-component
Language: Clojure
License: MIT
License Family: permissive
Last push: 2025-10-25T16:10:36+00:00

## Health v2 (maintenance only)
Score: 54/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 48, release rhythm 35, longevity 100
- inputs: {"age_days": 4699, "days_push": 312, "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 2161, forks 95 (observed 2026-08-28T04:06:20.971815+00:00)

## What it is
A small Clojure library for managing the lifecycle and dependencies of stateful components such as database connections, web servers, and caches. It implements a dependency-injection design pattern using immutable data structures, with start/stop lifecycle management.

## Use cases
- manage database connection lifecycle in a Clojure app
- dependency injection for stateful services in Clojure
- start and stop application components in a defined order
- structure a large Clojure application with clear boundaries
- share runtime state like HTTP connection pools across functions
- handle in-memory caches with explicit lifecycle

## When to choose
- building a Clojure application with multiple stateful resources that need ordered startup and shutdown
- you want explicit, declarative dependency graphs between services
- you prefer a lightweight design pattern over a heavyweight DI framework

## When to avoid
- writing mostly pure functional code with no shared runtime state
- using a language other than Clojure or ClojureScript
- you need a full-featured dependency injection container with auto-wiring

## Facets
- artifact type: library
- maturity: stable
- function: middleware, developer-tools
- domain: backend, developer-tools, programming-languages
- platform: jvm, jvm-scripting
- tags: clojure, dependency-injection, lifecycle-management, stateful-components, system-architecture

## Member repositories
- stuartsierra/component (main) score 54

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:20.971815+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-30T02:50:16.465322+00:00, confidence not recorded.
  - readme: https://github.com/stuartsierra/component (fetched 2026-08-28T04:06:20.971815+00:00, sha 244f77f14b38)
- Data as of 2026-08-30T08:39:29.467469+00:00.
