I have thought for some time how to integrate microservices. I like events a lot, but I don't want to make any coupling between services so I got an idea that I'd make some kind of adapter-microservice, which only purpose is subscribe the first service's events and then delegate call to another service's api (and maybe doing some enriching etc...). I'd like to ask that is that smart?
-
So, you want a 3rd Microservices to allow other Microservices to comunicate each other? If Yes, I suggest reading more about MS. The MS philosophy is just the opposite. Smart endpoints, dumb pipes.– LaivJun 1, 2017 at 18:40
-
There are two main goals using microservices: the first one is a loose coupling and the second one is a high cohesion. So tell me, what is better option to make microservices unaware from one another than using 3rd service to integrate them? There is no business logic in that integration service only code, which is able to adapt one's event to second's api call.– ToniJun 2, 2017 at 14:24
1 Answer
Adapter services make a lot of sense on multiple situations, particularly interfacing with legacy services which will be replaced over time.
What you are suggesting is basically what an Enterprise Service Bus provides to all related services... a big service to integrate all others, removing the coupling from the individual pieces, the tradeoff is that you create a big central service which can in turn become a big dependency. I find somewhat hard that you implement that as a microservice, as your requirements will probably change and extend to become a full system.
-
I also thought that ESB might be what I am looking for but I wasn't sure. Secondly I thought that I'd make each adapter as own service but here it makes a lot of management. Maybe some business process manager software would also be good choice?– ToniMay 30, 2017 at 20:02
-
While there is some intersection between what an ESB and a BPM will provide you, in general I would say that ESB is a better match to help you interconect microservices, while a BPM focus on providing a service that centralizes the business rules to be consumed by other services. Is like comparing the glue and the blueprint... tools for different purposes. As you said, implementing your own individual adapters imply adding a lot of additional management, in which you are somewhat reinventing the wheel. May 31, 2017 at 15:55