You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the situation that we have many partitions, each represented as a ra cluster. What are some of the best ways to keep track of which erlang nodes are running that cluster?
i.e. If I contact a random node, if it happens to be participating in that partition's cluster, it can tell me how to find the leader, which I can cache, but if the node is not a part of that cluster, I need some way to lookup and track which nodes are members of what cluster.
Is this typically done by creating another ra cluster that runs on all nodes that tracks this data? Whenever node membership changes, we update this mapping before removing, or after adding a node? Should I track only the nodes participating, or also the leader? If I track the leader, I need a way to monitor when leadership changes to update this value, which sounds like it could add complexity.
If I chose the method above, what are good ways to load balance the partitions across nodes? For looking up nodes in a partition, the data structure with be a map of partition_id => [node1, node2, ...], but for load balancing, it would be more useful to invert that map. to count partitions per node. I could calculate this on the fly if this is an uncommon operation, or maintain another version of the data if I need quick access. Another consideration, I would also want to distribute the leaders, not just cluster participants, as equally as possible since they would be taking the majority of the traffic, but not sure the best way to accomplish this.
Any thoughts? Are there more "built-in" or idiomatic ways of doing this that I'm not considering? Note: I'm using Elixir if that colors your response at all.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In the situation that we have many partitions, each represented as a ra cluster. What are some of the best ways to keep track of which erlang nodes are running that cluster?
i.e. If I contact a random node, if it happens to be participating in that partition's cluster, it can tell me how to find the leader, which I can cache, but if the node is not a part of that cluster, I need some way to lookup and track which nodes are members of what cluster.
partition_id => [node1, node2, ...]
, but for load balancing, it would be more useful to invert that map. to count partitions per node. I could calculate this on the fly if this is an uncommon operation, or maintain another version of the data if I need quick access. Another consideration, I would also want to distribute the leaders, not just cluster participants, as equally as possible since they would be taking the majority of the traffic, but not sure the best way to accomplish this.Any thoughts? Are there more "built-in" or idiomatic ways of doing this that I'm not considering? Note: I'm using Elixir if that colors your response at all.
Beta Was this translation helpful? Give feedback.
All reactions