Chapter D · 4 of 4~10 min

Feature flags lab

**Gradual rollout, kill switches, and A/B splits** — change behavior without redeploying.

Reviewed July 2026 · interactive lab

Paths & resources for this lesson

1Try it yourself

Playground

Feature flag lab

Flags control who sees what — without redeploying code.

New RAG index for 5% of traffic

2Read & reflect

Recap

#What you just did

You chose percentage rollout, kill switch, or A/B split for three ship scenarios.

Teach

#Pattern

if flags.is_on("new_rag_index", user_id, pct=5):
    retriever = index_v2
else:
    retriever = index_v1

Always log flag variant in traces so incidents tie to cohorts.

Use it

#When you'd use this

Watch out

#Watch out

Sticky bucketing matters — the same user should stay in one variant per experiment.

3Spark check

Continue learning · glossary & guides