PlayFab / consuldotnet

.NET API for Consul (http://www.consul.io/)
Apache License 2.0
692 stars 193 forks source link

Question about service discovery a la Microphone #63

Closed PhilipDaniels closed 8 years ago

PhilipDaniels commented 8 years ago

Hello,

I came across this project after researching microservices, specially service discovery in C#, which led me to the Microphone project and from there to here.

My ultimate aim is to use something like Owin-self-hosting, TopShelf, ILRepack and Consul to build small console exes that behave as RESTful microservices and that can simply be deployed onto boxes by copying one exe and have it "just work" - configuration and discovery being automatic.. It would be great for scalability and reliability too.

Microphone looked like a great start, but then I discovered that it doesn't actually use your Consul.Net library. That is not a show-stopper in itself, but that project also seems to be heading towards being agnostic about its back end and providing lots of options (Nancy, ETCD etc.) whereas my feeling is, if you're going to pick Consul, use it, and build something small and targeted at Consul. Too many options just makes for developer confusion and extra maintenance burden. Plus, it seems to be written using DotNetCore which means it pulls in about 40 dependencies and is hard to ILRepack.

So I was wondering about taking the principles and design expressed in Microphone and and just creating (let's say) Consul.Net.ServiceDiscovery.

I have had a look over the Microphone source and there is not a lot of code there, it doesn't feel like a massive job, though I'll need to get my employer to let me do it on their time.

I noted your question here, to which you never got a reply: https://github.com/rogeralsing/Microphone/issues/21

Have you thought about this at all, and do you have any particular direction in mind for Consul.Net?

highlyunavailable commented 8 years ago

Service discovery beyond the primitives Consul provides is not something I have planned for this project, but I know @lvermeulen has created a service discovery library called Nanophone that uses Consul.NET and is "heavily inspired" by Microphone.

The deps for that project seem very small and self-contained as well even in netcore, so that might be a good thing to check out. If you want to create a library that uses Consul.NET for service discovery, I'm happy to provide best-effort help, but as I said, my scope for this project is entirely on exposing the API primitives that Consul itself provides in a safe and .NET-idiomatic way.

lvermeulen commented 8 years ago

@PhilipDaniels You're welcome to have a look at Nanophone - thanks for the shout-out @highlyunavailable ! It uses Consul.NET for the Consul registry host (which is the only one I have right now) and supports Nancy and AspNetCore for .net 451 and netstandard 1.6 platforms. I will be releasing an update in the next few days which Version 1.3.0-alpha includes a.o. discovering the entire Consul service catalog (in passing state) and pluggable adapters for load balancers.

I'm in the process of trying to write something like fabio to load balance instances discovered with Nanophone. I called it Equalizer; hope to have something working this week, but the configurable routing is already there.

PhilipDaniels commented 8 years ago

@lvermeulen and @highlyunavailable Thanks for the feedback. Yes, Nanophone looks much more like what I am after, nice to know it is under active development.