# influitive/apartment

Database multi-tenancy for Rack (and Rails) applications

Repository: https://github.com/influitive/apartment
Canonical: https://ross.abutalabs.com/products/apartment
Language: Ruby
License Family: other
Last push: 2024-06-12T15:18:38+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 5089, "days_push": 812, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases, no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2683, forks 456 (observed 2026-08-28T04:07:10.125966+00:00)

## What it is
Apartment is a Ruby gem providing database-level multi-tenancy for Rack and Rails applications, supporting tenant isolation via PostgreSQL schemas or separate databases. It offers tenant creation, switching, and per-request tenant management integrated with ActiveRecord.

## Use cases
- isolate each customer's data in its own database schema in a Rails app
- switch tenants per request based on subdomain or user
- run migrations across all tenants
- sequester account or company data while sharing some common data
- create and manage tenants programmatically in a SaaS application

## When to choose
- you're building a Rails/Rack SaaS app needing schema- or database-per-tenant isolation
- you want drop-in ActiveRecord multi-tenancy with per-request tenant switching middleware

## When to avoid
- you use row-level tenancy (a tenant_id column) rather than schema/database isolation
- you're on a non-Ruby stack or non-ActiveRecord ORM
- you need a project under active development - it is in maintenance mode with no license file

## Facets
- artifact type: library
- maturity: maintenance
- function: database, orm, middleware
- domain: web-development, databases, backend
- platform: ruby
- tags: multitenancy, rails, activerecord, postgresql-schemas, tenant-isolation, web-server

## Member repositories
- influitive/apartment (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:10.125966+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:17:53.140937+00:00, confidence not recorded.
  - readme: https://github.com/influitive/apartment (fetched 2026-08-28T04:07:10.125966+00:00, sha 2c87da40e63d)
- Data as of 2026-08-30T08:39:29.467469+00:00.
