Hacker News new | ask | show | jobs
by pageald 2661 days ago
Environment variables are the best way to handle feature flags. The 12 factor app provides some guidance for doing it the right way. [0]

Feature flags do introduce complexity, but that can be partially mitigated by having good defaults and deleting flags once they're no longer needed. Even without that, as long as there are good defaults, you won't run into any problems until you have hundreds of flags.

I once worked on a system with tens of thousands of configuration flags that could all be overridden in an inheritance-esque chaining scheme, like Server A inherits regional config Foo which inherits from business unit config Bar, which inherits from three other 5000 line properties files. And naturally, almost none of these properties had defaults, so starting from scratch with a new configuration was impossible, leading to snowballing technical debt from copy pasting old configs. shudders

[0] https://12factor.net/config