What is the best way to access the state of a node from another node?
I have an application developed with Phoenix Framework(elixir phoenix). I want to run this application in multiple nodes to manage the traffic. I am leveraging the power of sockets provided by phoenix and so this application creates lot of sockets.
Our application has the need to store the presence information of the user. Taking help from this answer, I had created a watcher that maintains the presence information in the state of the watcher. I have to check whether the user is online by accessing the presence information.
When I do multi-node setup, users might be connected to any node. In such case, to check online status of a user, I need to access the presence information from all the nodes. And this operation is going to be very frequent.
What is the best way to accomplish this state access across nodes?
Can ETS be of any help here?
Can I use Genserver.call({node, name}, :identifier)
to get state? Is it a blocking call? Will this make the node slower?
Any other efficient way of doing it?