educative.io

Educative

Partition based on the hash of the term

c. Partition based on the hash of the term: Each term will be passed to a hash function, which will generate a server number and we will store the term on that server. This will make our term distribution random and hence minimize hotspots. The disadvantage of this scheme is, to find typeahead suggestions for a term we have to ask all the servers and then aggregate the results.

how can we partition based on the hash of the term? then, in the example above, we might have cap on one server and captain on another server. is that how it would work?