by phyrex · 2y ago · 0 comments
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.