Partitioner
Explore how to manage distributed workloads by integrating hash rings with group membership using the Tooz library. Learn to partition groups consistently, assign tasks across nodes, and run parallel processes efficiently to enhance system reliability and performance.
We'll cover the following...
Now that you know how a hash ring works and how to manage group memberships, we can start thinking about mixing the two.
On one side, we have a group system that can tell us which nodes in our distributed system are live, and on the other side, we have an object that tells us which node handles a piece of data. By updating the hash ring members using the group system that Tooz offers, we can construct a new object called a partitioned group.
Instead of building that into each application, Tooz provides an API that can
be leveraged while relying on both those mechanisms. The join_partitioned_group method allows an application to join a group in which all members share some workload using a consistent hash ring.
Note: You will need to start etcd to make the example work. Simply run
etcdfrom the command line in a separate terminal (open new terminal using+button beside Terminal tabs) before running ...