Quote:
Originally Posted by suzzer99
Is this like a runtime hot-config, or something different?
Sort of? I don't know if there's a formal definition. For us a feature flag is a name, a boolean, and a blob of json data.
If you add a new feature, you make a new FF for it. If you just want to turn it off/on then you don't add any data. But maybe you want to have a few knobs to turn, so you stuff those in the data blob. Like maybe thresholds or timeouts or percentage of the time to show A vs B, etc. So you can tweak those in real time and they instantly will take effect.
Most FF are short lived, like you add a feature, and once it's stable you remove the FF. The system I made has deprecation dates built in. If a deprecation date is set, then once the date is hit, the flag is treated as if it's always on and you'll get nagged about it periodically.
We have some long-lived FF though. Like we have a lot of APIs that are "paged" but the # of pages is nearly infinite. Normally we don't restrict how deep people go but every now and then someone will think it's a great idea to start up 100 threads and start plowing through "everything" in an endpoint. Or, once, due to a misconfiguration, thousands of clients all decided to walk a "subscription" endpoint from the beginning of time instead of just getting what's new since the last time they checked (i.e. everyone decided at once that they needed a few million pieces of data instead of the 0-10 they might normally get).
So if that happens again I can turn on this feature flag, that limits how deep you can go on certain endpoints, let things unwind, and then resolve everything.