Skip to content

Instantly share code, notes, and snippets.

@Nimrod007
Last active March 10, 2020 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nimrod007/843580c66ef973d6fb3b to your computer and use it in GitHub Desktop.
Save Nimrod007/843580c66ef973d6fb3b to your computer and use it in GitHub Desktop.
some feature toggle
{
"active" : true
}
@Nimrod007
Copy link
Author

Nimrod007 commented Mar 10, 2020

Dead Simple Feature Toggle
Sometimes you need a feature toggle in a rush … or just dont want to invest time in adding a feature toggle framework…

This thought came to me while I was working on some bot and had to protect myself with a feature toggle, problem was the bot was written with micro services, some in scala, some in java, some in php and even bash …

Main idea was to hold a centralised location with the feature toggle state, each service can obtain this state.

Ive made a list of the feature toggle requirement:

  • Protected with some kind of Auth
  • NO SSH to production machines.
  • Not code changes (in app), no deployments to change state
  • Change feature toggle state from any device with internet (phone, laptop, internet cafe etc…)
  • Hold record of state change (to know who and when changed the feature toggle state)

End result:

  • GitHub repo/gist with json file holding the feature toggle state – https://gist.github.com/Nimrod007/843580c66ef973d6fb3b
  • Easy to login and change the json with any device.
  • GitHub availability is high.
  • Each gist/repo has a change log so tracking changes is easy
  • Each micro-service will make a HTTP GET request to get the feature toggle state (this is expensive IO but can be reduced with caching on a file on the system that each micro-service can read from if needed)
  • Its FREE!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment