4 ms·
If Hash(attribute) % buckets == 0 That's basically all you need for this. The hash algorithm doesn't matter as long as it's fast and returns a number. For you
by phyrex 2y ago
If Hash(attribute) % buckets == 0
That's basically all you need for this. The hash algorithm doesn't matter as long as it's fast and returns a number.
For your example it's "hash(user_id) % 2" because a 50/50 split has two buckets.
- armank-dev 2y agoI had thought about this but didn't know if it was reliable for large-scale applications. Thank you!