finds.dev← search

// the find

tompave/fun_with_flags

★ 1,160 · Elixir · MIT · updated Sep 2025

Feature Flags/Toggles for Elixir

FunWithFlags is a feature flag library for Elixir that stores flags in Redis or a relational DB and caches them in ETS for fast lookups. It's a direct port of the Flipper Ruby gem's ideas into OTP, with explicit support for actor, group, percentage-of-time, and percentage-of-actors gates. If you're running a Phoenix app and need more than a global boolean toggle, this is the obvious starting point.

The two-level storage design (ETS cache + persistent store) is the right call — flag checks happen in hot paths and you don't want a Redis round-trip on every request. The gate priority model (actor > group > boolean > percentage) is well-thought-out and the interactions are documented with concrete examples rather than handwaving. The %-of-actors gate uses a deterministic hash of actor ID + flag name, so a user always gets the same result for a given rollout percentage — no sticky sessions or session storage required. The persistence layer is properly abstracted behind a behaviour, so swapping Redis for Postgres or writing a custom adapter is a real option, not a theoretical one.

No built-in audit log — you can't tell who changed a flag or when without bolting on your own solution, which matters when a flag change causes a production incident. The %-of-time and %-of-actors gates are mutually exclusive by design and the justification ('would needlessly overcomplicate priority rules') is hand-wavy — this is a real limitation if you want to roll out to 50% of actors but only during off-peak hours. The web dashboard is a separate package (fun_with_flags_ui) with its own dependency chain, which means the core library ships with no visibility into flag state without writing custom tooling. The application startup ordering problem with Phoenix PubSub is real and the fix (multiple config options across mix.exs and releases) is fiddly enough to trip up anyone not reading the docs carefully.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →