Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In a micro-service architecture, how the micro-services will be served?

I have read some articles and watched some videos, but did not find a concrete suggestion when it comes to serving those micro-services. My understanding is that they should be served with their own application server.

My question is should they be deployed on different servers or it does not matter.

When they are served on the same server(computer) won't there be port conflicts?

like image 393
Devs love ZenUML Avatar asked Dec 19 '13 23:12

Devs love ZenUML


1 Answers

I have read some articles and watched some videos, but did not find a concrete suggestion when it comes to serving those micro-services. My understanding is that they should be served with their own application server.

That is not really necessary. Frameworks such as Play and Spray do not need an application server.

See here - I quote:

You're also not going to find any true micro service based architectures that are hosted in an application server, that kinds of defeats the point. To this end micro services self host, they grab a port and listen. This means you'll lose any benefits your typical enterprise application server may bring and your service will need to provide some of the more essential ones (instrumentation, monitoring etc.).


My question is should they be deployed on different servers or it does not matter.

You definitely want to share servers to conserve hardware resources. Containerisation (see e.g. Docker and OpenShift) is quite a nice model.

When they are served on the same server(computer) won't there be port conflicts?

Not if you use Virtual IP addresses and bind to the VIP.

Alternatively, Docker has a different approach. It binds to a random port; then you could port forward that port on an "agreed" port for that service, to expose it to the outside world.

like image 139
Robin Green Avatar answered Sep 27 '22 22:09

Robin Green