Messaging using TCP #85
Replies: 1 comment 4 replies
-
@AntonWerenberg , you're welcome! Messaging is the ability to exchange messages between nodes in the cluster. The communication between the client and the cluster is not a responsibility of the library, so I would place this discussion out of the scope. You can implement any protocol and choose any framework for that, e.g. ASP.NET Core.
For Gossip-based messaging you can use HyParView membership protocol provided out-of-the-box. Unicast communication is supported for HTTP transport only. This type of communication allows to send the message from one node to another node in the cluster, or even route message to the leader node. For more information about this type of messaging, see this article. TCP and UDP transport for Raft do not support unicast messaging. Strictly speaking, unicast/broadcast custom messages are not the part of Raft specification. However, you still can implement this functionality on top of TCP using any appropriate serialization format: MessagePack, Protobuf, JSON or even your own wire format. And one more thing - it looks strange that you want to generate the data on the node and the node itself is a cluster member. Typically, you have dedicated Raft cluster working as distributed data storage and the set of clients. Client typically doesn't participate in replication. |
Beta Was this translation helpful? Give feedback.
-
From the documentation, I can read that it is possible to implement Messaging between nodes when using HTTP.
Is this the same case for TCP?
Where would be a good place to start?
Does messaging in TCP have the same capabilities regarding Leader routing?
In my setup, the different nodes all generate data that should be sent to the leader for replication.
Once again thanks for creating such a nice Raft implementation
Beta Was this translation helpful? Give feedback.
All reactions