At first glace, Feature Flags and Environment Variables might seem like they are similar, but as we’ll see, they fulfill vastly different roles and conflating the two can be problematic.
To choose between the two
- Toggle behavior on the fly
- Independent of environment
- If need to decide during app startup
- More rigid between environments
Issue I had… I was starting Apollo Server
If it’s a configuration you are passing to a service that is starting, then remote FF may not work. For example, I thought, “Let me have a FF toggle to turn GraphQL introspection on/off on the server”.
- This value cannot be dynamically changed, would take a server restart to pick up a new value.
- This value is needed immediately on boot up. While using Unleash, the remove connection to the server was not yet initialized when the Apollo server needed the configuration.
Did this help you out? It took me a few days to piece together all this information together, I hope this saves you some time (who knows, maybe the future me will be thankful I wrote this down). Let me know your thoughts. [email protected]