Since others have mentioned them already: yes, this is what feature flag systems are for. They're not just for rollouts and experiments, though they're good at that too. Where they're <i>especially</i> good is with targeting rules, but more on that later.<p>There are already several good open source and commercial flag systems[1], some of which have SDKs for many different server-side and client-side languages, e.g. Growthbook[2].<p>At its most basic, a feature flag client SDK lets you evaluate a variable instantly, without blocking/async, because the variable was already fetched and cached when your app started up. The SDK also maintains an ongoing background mechanism of some kind to keep that cache updated with changes from the server; the most popular method is polling (i.e. re-fetch the variables every X seconds) but a more effective way is to keep a single long-lived HTTP connection open to the server and listen for Server-Sent Events. The SDK should also, ideally, emit in-app events whenever changes arrive.<p>Targeting rules are what make feature flags much more useful: they allow you to define logic that changes the evaluation of a flag depending on context. For example: enabling new features or new code versions depending on who the current user is, or which server is handling the request, or the current time of day. Sure, this is all logic you could do in code, but then every change to that logic requires an update and restart. Having the logic stored and communicated with the flag gives you a separate level of control that's much easier and faster to change.<p>So yeah, what you're doing here is creating yet another feature flag system. Even if you're saying "but this is meant for simpler stuff" I would honestly just go with an existing, somewhat mature system like Posthog or Growthbook than invest any more engineering time in this, unless you have major use cases in mind that they don't support - and even then, I would be careful. Simplicity alone does not give you any real advantage that is worth the effort.<p>[1] <a href="https://github.com/andrewdmaclean/awesome-feature-flag-management">https://github.com/andrewdmaclean/awesome-feature-flag-manag...</a><p>[2] <a href="https://www.growthbook.io/">https://www.growthbook.io/</a>