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

Clustered Connections #764

Open
ghost opened this issue Sep 30, 2019 · 3 comments
Open

Clustered Connections #764

ghost opened this issue Sep 30, 2019 · 3 comments
Labels
feature-request New feature or request

Comments

@ghost
Copy link

ghost commented Sep 30, 2019

Describe the feature request

Support for clustered connections like the NATS Broker official clients have. Example:

string[] servers = new string[] {
                "nats:https://serverA:1222",
                "nats:https://serverB:1222"
            };

            Options opts = ConnectionFactory.GetDefaultOptions();
            opts.MaxReconnect = 2;
            opts.ReconnectWait = 1000;
            opts.NoRandomize = true;
            opts.Servers = servers;

            IConnection c = new ConnectionFactory().CreateConnection(opts);

Which project is your feature request related to?

  • ManagedClient

Additional context

I believe adding clustered support to MQTTnet on top of its current capabilities would place MQTTnet another step ahead of the "competition". To my knowledge there is no MQTT client out there with built-in clustered support.

An MQTT client that saves the developer infrastructure costs and other "Load Balancer" related head aches would be nearly impossible to say no to. In fact, it would make me very excited.

@ghost ghost added the feature-request New feature or request label Sep 30, 2019
@JanEggers
Copy link
Contributor

the idea is nice but I think this is a Broker feature as the Broker must relay messages to other cluster nodes. Also I think it is better to have LoadBalancer / failover strategies in a broker rather than in the client to cut on latency.

@ghost
Copy link
Author

ghost commented Oct 2, 2019

Hi @JanEggers.

Yes, the inter-node gossip necessary to form a logical cluster is a Broker feature, however once the cluster is formed one can connect to any node (at least this is the case with EMQX, my broker of choice) in order to interact with it.

Question is, which node? Since MQTTnet only allows one connection endpoint, this requires a load balancer of sorts, either "DNS" or traditional.

DNS I don't touch with a pole; it's simply too unreliable due to aggressive DNS caching by third parties (ISPs etc) and my hosting provider's LB offering is... questionable to put it mildly.

They have only one LB offering @ 100 Mbps when even the cheapest dev servers come with 100 Mbps bandwidth. A dev MQTT cluster with 3 nodes would be able to support 300 Mbps (aggregated) and a LB @ 100 Mbps would rather bottleneck the cluster instead of load balancing it.

There is a promise of a 600 Mbps LB coming "soon", but that's Tooth Faerie speak, can't really be relied upon. Not to mention that a 600 Mbps LB would be useless for production when the cheapest production server bandwidth starts @ 300 Mbps (900 Mbps aggregated for a 3 node MQTT cluster).

I'm sure the predicament is obvious by now. However there is hope. If the developers & maintainers of MQTTnet embrace the idea of clustered connections and add the feature to the client, that would quickly dispel all this non-sense.

@ghost
Copy link
Author

ghost commented Oct 2, 2019

And just to make sure any possible confusion goes the way of the Dodo bird:

clustered connection is NATS speak (buzz word) for the possibility to specify a server list in the client and have the client automatically find an available server to connect to.

The above, plus a connection strategy (random/round-robin). Nothing too fancy.

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

No branches or pull requests

1 participant