Search code examples
c++ignitecolocation

Apache Ignite: Manual Data Colocation


So I understand data can be colocated together by use of an affinity function.

My questions is, if it is possible to force data to be placed in a particular node? And then force rebalancing if I need that partition to be moved to another node.

This would be useful for a scenario where I have a client that will be using a server the most to access his data and there'd be an ignite node very close, network wise, to this server. I'd like the data for this client to be as close as possible to where it's used.

But now say this client moves to another server, I'd like to be able to move his data to a node that is closer to the new server.

Is this behavior possible in Ignite?


Solution

  • You can use a node filter to limit which nodes store data, but you can't easily force data to a specific node.

    But the good news is that's really a design anti-pattern. You should let Ignite figure it out for you.

    Part of the reason for that is that you appear to assume that a client connects to a server. That's not the case. Ignite nodes are peers. Any node can connect directly to any other in the cluster. (Perhaps you have a "stretched cluster," one that's spread across multiple data centres? Because a cluster is peer-to-peer, this is generally not recommended.)