You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/tech-recommendations/infrastructure.md
+33Lines changed: 33 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,4 +51,37 @@ If Terraform, use OpenTofu
51
51
52
52
Serverless is deprecated
53
53
54
+
## Feature flags
54
55
56
+
Feature flags allow us to change application behavior at runtime without redeploying code. In our stack, we use [AWS AppConfig](https://docs.aws.amazon.com/appconfig/latest/userguide/what-is-appconfig.html) to manage these changes safely, whether that’s rolling out a new feature, limiting exposure, or quickly turning something off if it causes issues.
57
+
58
+
At a high level, feature flags help separate deployment (shipping code) from release (exposing functionality), which gives us much more control over risk. [View this example AppConfig implementation for guidance within React](https://github.com/timwright12/example-aws-appconfig/).
59
+
60
+
### When to use feature flags
61
+
62
+
Feature flags are most useful when you need a level of control or reversibility that a normal deployment doesn’t provide. Use flags when you need controlled, reversible changes. For example:
63
+
64
+
- Gradual roll outs (releasing to a percentage of users before full launch)
65
+
- Kill switches (quickly disabling a feature causing issues)
66
+
- Decoupled deploy vs release (shipping code without immediately exposing it)
67
+
- Environment-specific behavior (safely testing in staging or limited production cohorts)
68
+
- Simple targeting (enabling for internal users, beta groups, or regions)
69
+
70
+
### When not to use feature flags
71
+
72
+
Not every toggle should be a feature flag. In fact, overusing them can make the system harder to reason maintain. Avoid using feature flags for to following:
73
+
74
+
- Permanent configuration (use environment variables or config files instead)
75
+
- Short-lived development toggles (prefer local flags or mocks during development)
76
+
- Core business logic branching (flags should not define fundamentally different code paths long-term)
77
+
- Highly coupled UI logic (excessive flags in UI code can create hard-to-test states)
78
+
- Anything you won’t clean up (if there’s no plan to remove it, don’t add a flag)
79
+
- As a substitute for proper testing (flags shouldn't compensate for inadequate QA)
80
+
81
+
### Best practices
82
+
83
+
- Default to a safe state of `false` for features that are incomplete
84
+
- Every flag should have a clear lifecycle and purpose
85
+
- Use clear naming in your flags
86
+
- Each flag should be as close the feature it is toggling a possible; avoid wrapping too much functionality in a flag.
87
+
- Clean up flags regularly; unless you're using a killswitch flag, most types should not be long-lived in the code. Clean them up when your done.
0 commit comments