Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple example #1

Open
daanpape opened this issue Aug 5, 2019 · 3 comments
Open

Simple example #1

daanpape opened this issue Aug 5, 2019 · 3 comments

Comments

@daanpape
Copy link

daanpape commented Aug 5, 2019

Hello,

I've recently discovered this repository after searching for a reliable broadcast solution without the need for a centralised broker (like MQTT).

Reliable for me means the following:

  • Every node in the group which is connected to the network will receive exactly 1 and only 1 copy of the message.
  • Messages are delivered to the application as a hole and not fragmented.
  • Nice to have but not required: messages from the same sender node are delivered in order.

I'm not a theoretical person but I briefly traversed the paper and if I understood correctly this is exactly what the hyparview algorithm does based on the Plumtree gossip protocol.

I now want to do 2 things:

  • Test this code out by creating a group of 3 nodes and let them send messages to each other.
  • In case this is what we need I will port this library to C so that it can run on resource constrained devices.

Now to the point. It would be very helpful if an example program could be supplied which allows us to test the library. I'm willing to write this but I would need a head start as my Rust is a bit rusty.

Kind regards,
Daan

@sile
Copy link
Owner

sile commented Aug 13, 2019

Hi,

Sorry for the late reply.
A real usage example of this crate is found in https://github.com/sile/plumcast (plumcast isn't a small crate though ...).

It is possible to create a simple example, but I'm concerned that HyParView(and Plumtree) may not meet your requirements. Please see https://docs.rs/plumcast/0.1.5/plumcast/#cons.

@daanpape
Copy link
Author

Hi Sile,

Thank you very much for your reply. I was in the assumption that HyParView was an extension on Plumtree which guaranteed that a message arrives.

I will try out the plumcast program, thank you for the link.

@sile
Copy link
Owner

sile commented Aug 13, 2019

I was in the assumption that HyParView was an extension on Plumtree which guaranteed that a message arrives.

In my understanding, the main role of HyParView is membership management of a cluster.
It is scalable, fault tolerant and it doesn't require a central node. However there is no strong guarantee about connectivity of a cluster. With pure HyParView algorithm alone, in very rare cases, cluster split may occur (and HyParView cannot detect the split).
To detect the split, I sometime implement heartbeat mechanizm that uses a strong consistent service (e.g., etcd, consul) for checking the connectivity of a cluster.

The main role of Plumtree is enabling an efficient message broadcast.
Plumtree uses HyParView (or something else) for underlaying cluster member management.
Plumtree builds and manages a fault-tolerant, dynamic spanning tree on the top of the underlying cluster, and broadcasts messages through the tree.
The one of the most difficult points of Plumtree is deciding on an appropriate message buffer size.
If the buffer size is too small, some messages may drop or be delivered more than once. Conversely, if the buffer size is too large, it may exhaust system memory (RAM).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants