Bucketting and MurmurHash in Variation Assignment
MurmurHash is a non-cryptographic hashing algorithm used for fast, consistent hashing of data (in this case, userId).
It is deterministic, meaning the same input always produces the same hash output — which is why it’s perfect for A/B testing bucketing.
Speed: Optimized for performance in backend services.
Uniform Distribution: Spreads users evenly across the hash space.
Consistency: Same userId and experiment will always produce the same hash value.
Lightweight: Low CPU and memory usage, suitable for high-traffic apps.
How MurmurHash Works in Our SDK:
1. Hash Input Creation : The userId is taken as the primary input, Sometimes combined with experiment-specific data to ensure experiment-level uniqueness:
ex: experimentName+"_"+userId
2. Hash Generation : The input string is run through MurmurHash to generate a numeric value.
3. Value Normalization : The hash output is modulo 10,000 (% 10000) to create a value between 0 and 9999, this becomes the user's bucket number.
Bucketing Logic
Once we have the bucket number (0–9999), the SDK uses traffic allocation ranges to decide which variation the user sees.
Variation | Traffic Allocation (%) | Bucket Range |
Original | 20% | 0 – 1999 |
Variation 1 | 20% | 2000 – 3999 |
Variation 2 | 20% | 4000 – 5999 |
Variation 3 | 20% | 6000 – 7999 |
Variation 4 | 20% | 8000 – 9999 |
Key Rules
Non-overlapping ranges — a bucket number can only belong to one variation.
Collectively exhaustive — all allocated traffic ranges are covered without gaps within the allocation pool.
Users outside allocated traffic are excluded (returns null).
Deterministic & Sticky Assignment
For an experiment, the same user will always land in the same bucket, same variation across sessions. Changing the traffic allocation or variation setup in the dashboard will change bucket ranges and may reassign some users.