Evaluate the options for Python for real-time feature configuration and impact control
This article describes use of “feature flags” to finely control the “blast radius” of changes, done in order to deliver changes faster while minimizing risk.
NOTE: Content here are my personal opinions, and not intended to represent any employer (past or present). “PROTIP:” here highlight information I haven’t seen elsewhere on the internet because it is hard-won, little-know but significant facts based on my personal research and experience.
Traditionally, new or updated features made available via a software deployment become visible to ALL users at the same time. And to fix a poorly-implemented feature requires an immediately roll back to the prior version, or to create a fix as quickly as possible and roll forward by deploying a new version. That is risky and stressful.
“Upgrade infrastructure safely. Change configurations on the fly. Dynamically control everything in real-time.”
Easier said than done.
Feature flags enable “testing in production”.
Run-time feature flags
Martin Fowler calls Feature Toggles a design pattern:
“Toggles introduce complexity. We can keep that complexity in check by using smart toggle implementation practices and appropriate tools to manage our toggle configuration, but we should also aim to constrain the number of toggles in our system.””
So feature flags are now a central facet of programming templates.
So, different implementations exist for each language.
Many systems already provide services for managing feature flags and reporting/analysis:
Jira has a “Feature Flags” tab:
<a target=”_blank” href=https://user-images.githubusercontent.com/300046/125816357-790f7657-ad40-4f2a-9a8b-26e8b859aa7c.png”> </a>
argparse is a built-in module of Python to enable user-friendly command-line interfaces.
The list of utilities at “The Hub for Feature Flag Driven Development” is rather disappointing.
https://github.com/trustrachel/Flask-FeatureFlags by @trustrachel Sanders was archived in 2015.
https://github.com/disqus/gutter was archived Dec 17, 2015.
https://github.com/venmo/feature_ramp by Amanda Schloss and Anthony Yim for “Toggling and ramping features via a lightweight Redis backend.” has not been updated since Aug 21, 2015.
If you can a spare $90/month, https://launchdarkly.com provides a GUI from a server that turn tags on and off.
Your program would query their server real-time to determine what to do.
The server has “Pluggable configuration backends”.
CAUTION: This architecture may not be approapriate if you’re concerned about excess bandwidth usage and possible leak of secret data over the wire.
PROTIP: It’s shiny unique feature is support for default fallback calls.
As with any server, it has logging features. For more money, it integrate with audit logs, and analytics with user segmentation.
For an additional $390/month, you get support for A/B experimentation.
BLAH: Wish they would offer a free edition.
https://github.com/ashcrow/flagon was last updated May 20, 2017 by Stephen Milner (@ashcrow), now CoreOS boss at Red Hat.
It’s based on Java’s Togglz and makes use of http://werkzeug.pocoo.org/ WGI, from the same folks.
Look at the configuration file listing the status of each flag:
The results file:
The code making use of the flag:
Harness has Feature Flags as part of its CI/CD and Cost Management SaaS offering.
Walkme demo of Harness CD runs a sample deployment in a Kubernetes Cluster within Google Cloud Platform (GKE), available for 1 hour.
https://www.harness.com calls it “progressive delivery” https://harness.io/blog/product-updates/introducing-harness-feature-flags/
More about Python
This is one of a series about Python:
- Python install on MacOS
- Python install on MacOS using Pyenv
- Python tutorials
- Python Examples
- Python coding notes
- Pulumi controls cloud using Python, etc.
- Test Python using Pytest BDD Selenium framework
- Test Python using Robot testing framework
- Python REST API programming using the Flask library
- Python coding for AWS Lambda Serverless programming
- Streamlit visualization framework powered by Python
- Web scraping using Scrapy, powered by Python
- Neo4j graph databases accessed from Python