Skip to content

sgs-97/redis-feature-flags

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

48 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

redis-feature-flags

Feature flags for teams that already run Redis. No new server. No new cost. Your data stays in your infrastructure.

πŸ“¦ PyPI Β· Maven Central Β· CLI Β· πŸ“– Documentation


Why?

Most teams already run Redis. It sits in your stack as a cache or a session store. You are already paying for it, operating it, and trusting it.

Feature flag SaaS products charge hundreds of dollars a month for a server you do not need, send your user data to their infrastructure, and add another thing to monitor.

But why not just use environment variables or application.properties?

Every minor change requires a redeployment. A feature flag lets you change behavior instantly. No code push, no restart, no downtime. Flip a flag and it takes effect in milliseconds across every running instance.

redis-feature-flags uses the Redis you already have. Nothing else.

Who is this for?

  • Startups and small teams who already run Redis and want to avoid adding new infrastructure
  • Teams that are cost-conscious and want to eliminate SaaS subscriptions
  • Developers who want full control over their data. No third party ever sees your flag evaluations
  • Teams that value simplicity. No new service to deploy, monitor, or on-call for

If you already have Redis in your stack, this is a zero-overhead addition.


What you get

Gradual rollout β€” release to 1%, then 10%, then 100%. Same user always gets the same answer. Deterministic, no randomness.

User targeting β€” give specific users early access regardless of rollout percentage.

Cohort targeting β€” target entire groups at once. Beta testers, enterprise users, internal teams.

Kill switch β€” disable any feature instantly for everyone. No redeploy. No waiting.

Flag expiry β€” auto-expire flags at a timestamp. No cleanup needed.

Multiple environments β€” prod, staging, and dev on one Redis instance. Fully isolated. No key collisions.

Works when Redis is down β€” stale cache keeps serving the last known state. Your application never crashes.

CLI included β€” manage flags from your terminal. Works with Python and Java SDKs.

Well tested β€” 94 Python SDK tests at 100% coverage, 109 Java tests, e2e tests against real Redis.


Install

# Python SDK
pip install redis-feature-flags

# CLI
pip install redis-flags
<!-- Java SDK -->
<dependency>
    <groupId>io.github.sgs-97</groupId>
    <artifactId>redis-feature-flags</artifactId>
    <version>1.0.0</version>
</dependency>

Quickstart

import redis
from redis_feature_flags import FeatureFlags

r = redis.Redis()
flags = FeatureFlags(r, env="prod")

flags.create("dark_mode", rollout=10)
flags.enable("dark_mode")

flags.is_enabled("dark_mode", user_id="alice")  # β†’ True or False

# Kill switch β€” instant off for everyone
flags.disable("dark_mode")

CLI

redis-flags use prod
redis-flags create dark_mode --rollout 10
redis-flags enable dark_mode
redis-flags list
redis-flags inspect dark_mode

Supported languages

Language Package Status
Python PyPI stable
Java Maven Central stable
TypeScript npm coming soon
Go go modules coming soon

Performance


Requirements

  • Python 3.9+ or Java 17+
  • Redis 6.0+

License

MIT β€” Gayatri Sravya Siripurapu


Community

Contributions welcome.

For security vulnerabilities do not open a public issue. See SECURITY.md.