News for hackers. Stuff that matters.
Re:It's OK to hardcode feature flags by the_mitsuhiko on Saturday February 01, 2025 @02:28PM (#42901324)
> I think there's a reasonable middle ground-point between having feature flags in a JSON file that you have to redeploy to change and using an (often expensive) feature flags as a service platform: roll your own simple system.

The middle ground is a JSON file that is copied up and periodically refreshed. We (Sentry) moved from a managed software to just a YAML file with feature flags that is pushed to all containers.

The benefit of just changing a file is that you have a lot of freedom of how you deal with it (eg: leave comments) and you have the history of who flipped it and for which reason.

Re:It's OK to hardcode feature flags by maccard on Saturday February 01, 2025 @02:35PM (#42901391)
How do you push the files to all of your containers? I’ve done this in the past with app specific endpoints but never found a solution I liked with containers.
Re:It's OK to hardcode feature flags by superb_dev on Saturday February 01, 2025 @02:40PM (#42901441)
We keep a JSON blob in Google Secret Manager for our flags. The service running in the container will reload the secret anytime it changes
Re:It's OK to hardcode feature flags by maccard on Saturday February 01, 2025 @03:33PM (#42901972)
Ah that’s a super nice feature. I’m mostly familiar with AWS who don’t have a neat way of doing this, you end up with a bespoke solution either with lambdas pushing to shared volumes or just polling s3 for updates.
Re:It's OK to hardcode feature flags by withinboredom on Saturday February 01, 2025 @04:45PM (#42902680)
If you are using kubernetes, you can mount the secret/ConfigMap as a volume and it will be updated automatically when changes occur. Then your application merely watches the file for updates.
Re:It's OK to hardcode feature flags by maccard on Saturday February 01, 2025 @06:03PM (#42903419)
Being on AWS, using EKS feels like overkill when you're talking $75/month just for having it managed by AWS. This doesn't work with ECS, unfortunately, or if you're just running docker on EC2.
Re:It's OK to hardcode feature flags by moltar on Sunday February 02, 2025 @06:25AM (#42907966)
AWS has a native service for this called AppConfig and has agents that can pull and cache flag values so your services only need to make localhost requests.
Re:It's OK to hardcode feature flags by maccard on Monday February 03, 2025 @11:24AM (#42919847)
AH nice, I was not aware of this. Thanks (It is expensive, though...)
Re:It's OK to hardcode feature flags by moltar on Monday February 03, 2025 @07:25PM (#42925521)
Expensive?? Really? One of the cheapest services around.

$0.0000002 per configuration request

Re:It's OK to hardcode feature flags by maccard on Tuesday February 04, 2025 @06:27AM (#42931023)
Depending on when you’re evaluating it’s a per request overhead. You might/provably have multiple flags per request. Compared to a lambda invocation that pushes a config file to every container if it changes, it’s expensive.
Re:It's OK to hardcode feature flags by the_mitsuhiko on Saturday February 01, 2025 @05:01PM (#42902845)
We currently persist the feature flag config in a database where the containers pull it from. Not the optimal solution but that was a natural evolution from a system we already had in place.