views:

123

answers:

1

Hi all,

I am in the process of designing a client server app that will use WCF to communicate with the client. It is possible it could become heavily loaded and want to design it in a distributed manner. To that end I have split the application into a number of services. N number of services could be running to deal with the requests.

  • Login service
  • game service
  • room service
  • etc

The login service would be able to have a load balancer on it. it would then send the request off to one of the game services running, (there could be N game services running on different machines).

What I am trying to figure out is how could the login service know about the game services. I can think of (at a real high level at this point) two solutions:

1) When a game service comes up it creates a record in the database saying who it is and where it is, the login service checks there to find all services. This seems to have problems, services dropping, keeping the list up to date.

2) When a new service joins it contacts a login service, (not sure how that would happen, presume some sort of hard coding on how to find it), and registers with that service. The login service could then maintain a DHT or some list among them so they know where to route the request.

I am new to the whole distributed apps world and trying to figure out a good way of doing things. This project is partly for my own knowledge and gain but also I hope it will progress into a working app.

Thanks

+2  A: 

I would think this is the perfect application for a service bus. Let it be the platform on which your services reside. The bus provides a layer of abstraction over the actual physical configuration of your network and it's hosts, allowing for scalability... it's all in the underpinnings.

Using the bus, you can proceed with the pub/sub approach for communicating across services, or more to the point, across business concerns.

I would avoid the database approach in #1 for keeping a manifest of services, instead keeping that information in the running configuration of the bus. With a pub/sub approach, and potentially routing information contained therein, you should be on the right approach.

Have a look at NServiceBus or MassTransit

Mike L
Hi Mike, I was thinking about this on the train home today and was starting down a similar sort of road. Thank you for the descriptions and links. MassTransit actually rings a bell, saw a seminar on that a fair while ago.
Jon
Jon,Funny enough, I've been listening to an episode of Hanselminutes with Udi Dahan of NServiceBus. (http://www.hanselminutes.com/default.aspx?showID=194)Also, there was an episode of the elegant code podcast with the guys from Mass Transit (http://elegantcode.com/2009/03/18/code-cast-25-masstransit/).I have no experience with either, but I'm strongly looking into a service bus idea for some things at work.Good luck!
Mike L
Great links, thanks
Jon