Infrastructure low complexity Shared Component backend
0
Dependencies
1
Dependents
3
Entities
0
Integrations

Description

Redis caching layer for feature flag resolution. Stores per-organization feature maps with a 60-second TTL so that API middleware can resolve feature access without hitting PostgreSQL on every request. Handles cache invalidation when flags are updated via the admin portal.

Feature: Feature Toggles

feature-flag-cache-adapter

Responsibilities

  • Cache per-organization feature flag maps in Redis with 60-second TTL
  • Retrieve cached feature maps for fast middleware resolution
  • Invalidate single flag entries or full organization caches on update
  • Handle Redis connection failures gracefully with PostgreSQL fallback

Interfaces

getCachedFlagMap(organizationId: string): Promise<Record<string, boolean> | null>
setCachedFlagMap(organizationId: string, flagMap: Record<string, boolean>, ttl?: number): Promise<void>
invalidateFlagMap(organizationId: string): Promise<void>
invalidateSingleFlag(organizationId: string, featureKey: string): Promise<void>
isAvailable(): boolean

Relationships

Dependents (1)

Components that depend on this component