/ THE IDEA
A common approach turns a stable user identifier into a repeatable numerical bucket. A hash is a function that maps input data to a compact value; here its job is assignment, not secrecy. Combining user identity with a flag identifier gives a stable bucket for that particular feature. The flag compares the bucket with a rollout threshold. Raising the threshold includes more buckets while retaining the original group. This is sometimes called stickiness: repeated visits with the same identifying context receive the same assignment. A fraction of users is not necessarily the same fraction of requests or processor work.
THE FORMAL IDEA
enabled = bucket(user, flag) < p
| bucket is a repeatable value between 0 inclusive and 1 exclusive; p is the rollout fraction in that same range. | | Neither value has units. With a suitably spread assignment, p = 0.05 selects approximately 5% of a large user population. |
|
RUN THE TINY EXAMPLE
Change one thing. Predict what happens.
Three example users have buckets 0.03, 0.12 and 0.87. At p = 0.05, only the first receives the feature. Change p to 0.20: the first and second receive it; the third does not. For 10,000 evenly spread users, expected exposure grows from about 500 to about 2,000.
|
The first user remains included when the threshold increases. Randomly choosing afresh on every request would not give that continuity. The population estimate is approximate: a particular small audience need not contain exactly the chosen percentage.
/ SO WHAT?
For a useful release checklist, record the identifying context, the safe default when the flag system is unavailable and who can disable the feature. Also plan removal: obsolete flags create extra combinations of behaviour that future developers must understand and test.
ONE CAVEAT |
| A flag is not an authorisation check or a guarantee of isolation. New code may run background work even for unselected users, and changing persistent data can make disabling the feature insufficient to undo its effects. |
KEEP THIS
A stable assignment and an adjustable threshold let exposure grow while keeping earlier users in the same rollout group.
|
NEXT: Why a steeper energy drop means a stronger push
|