Auto-sync: 2026-04-16 17:30

This commit is contained in:
2026-04-16 17:30:41 +08:00
parent b2250c60b2
commit c999498de4
662 changed files with 3797 additions and 21340 deletions

View File

@@ -0,0 +1,35 @@
---
title: "Feature Flag"
type: concept
tags: [持续交付, 特性管理, 发布工程]
sources: ["https://launchdarkly.com/blog/rto-vs-rpo/"]
last_updated: 2025-07-26
---
## Definition
Feature Flag特性开关是一种将代码部署与功能发布分离的技术允许在不重新部署的情况下通过配置切换代码执行路径。
## Key Concepts
- Deploy != Release部署代码但不立即向用户开放
- Kill Switch紧急关闭机制用于快速禁用问题功能
- 渐进式 Rollout分阶段向用户群发布1% → 5% → 25% → 100%
## Benefits for RTO/RPO
- RTO从小时级降至秒级只需关闭开关
- RPORollback 时不丢失数据,只需切换代码路径
## Code Example
```javascript
if (featureFlag.enabled('new-checkout-flow')) {
return newCheckoutProcess();
} else {
return oldCheckoutProcess();
}
```
## Connections
- [[Kill Switch]] ← 紧急机制 → [[Feature Flag]]
- [[渐进式发布]] ← 发布策略 → [[Feature Flag]]
- [[RTO (Recovery Time Objective)]] ← 降低工具 → [[Feature Flag]]
- [[RPO (Recovery Point Objective)]] ← 保护工具 → [[Feature Flag]]
- [[LaunchDarkly]] ← 平台 → [[Feature Flag]]