Sticky bucketing

Also called: consistent bucketing, deterministic bucketing

Last updated:

Sticky bucketing — also called deterministic or consistent bucketing — is how a feature flag keeps a user's assignment stable. Rather than drawing a fresh random number on each check, the SDK hashes the user identifier together with the flag key into a fixed bucket from 0 to 99. The hash is pure, so the same user and the same flag always produce the same bucket, on every server and every request.

Why stickiness matters

Without it, a 10% percentage rollout would re-roll on every request and a user would flicker in and out of the feature — a jarring experience and useless experiment data. Because the bucket is deterministic, raising the rollout from 10% to 25% only adds users to the enabled cohort; the original 10% never move. The same property lets an A/B test hold a clean, stable split for the life of the experiment.

How the bucket is computed

The SDK hashes the user identifier and the flag key together and maps the result onto 0–99. Folding the flag key into the input means one user gets independent buckets across different flags, so unrelated rollouts never correlate. The computation runs locally against in-memory configuration, so it is sub-millisecond, needs no coordination between servers, and produces the same deterministic result across every Featureflip SDK. It is the mechanism a targeted rollout layers on top of when it rolls out to a percentage within a chosen audience; the rollout strategies guide covers the serving model.

Want the full picture? Read the concept guide: Rollout strategies →

Try it in your own app

Free Solo plan covers 10 flags and 2 environments. No credit card, no demo call — sign up and ship.