From 9075261d30eff2642a3e3cbccaa6147a4777ea20 Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Tue, 23 Nov 2021 14:59:23 +0100 Subject: [PATCH] docs: add basic info to stickiness. --- website/docs/advanced/stickiness.md | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/website/docs/advanced/stickiness.md b/website/docs/advanced/stickiness.md index f8b2de6a42..f4e2461b81 100644 --- a/website/docs/advanced/stickiness.md +++ b/website/docs/advanced/stickiness.md @@ -3,8 +3,19 @@ id: stickiness title: Stickiness --- -## What is stickiness -## When do I use it? -## How does it work? -## Is it consistent? -## Custom stickines +Stickiness is how Unleash guarantees that the same user gets the same features every time. Stickiness is useful in any scenario where you want to either show a feature to only a subset of users or give users a variant of a feature. + +## Calculation + +By default, Unleash calculates stickiness based on the user id and the group id. If the user id is unavailable, it falls back to using the session id instead. It hashes these values to a number between 0 and 100. This number is what determines whether a user will see a specific feature or variant. Because the process is deterministic, the same user will always get the same number. + +## Consistency + +Because the number assigned to a user won't change, Unleash also guarantees that the a user will keep seeing the same features even if certain other parameters change. + +When using the [gradual rollout activation strategy](https://docs.getunleash.io/user_guide/activation_strategy#gradual-rollout), any user whose number is less than or equal to the rollout percentage. This means that the same users will keep seeing the feature even if you increase the percentage of your user base that sees the feature. + + +## Custom stickiness + +Gradual rollout and variants allow you to use a custom stickiness ...