In microservices architecture, autonomous business services should talk directly with each other. The communication may be synchronous (orchestration) or event-based (choreography). An API gateway may aggregate the API's for the client (backends for frontends). With microservices we are seeking two ultimate goals
Which grants continuous deployment, fine-grained scaling, rapid technology adaptation, reusability, auditability an much more, of course for the price of higher complexity.
However, it is highly discouraged to use ESB (Enterprise Service Bus) or other middleware. Microservices and ESB is often seen as an rival solutions. Why is an ESB seen so bad? As long as it is just used as an meditation channel with some additional monitoring and authentication layers (no business logic), what's the problem of using it in the microservice architecture?
Hybrid ESB/microservices: A mix of monolithic applications and cloud-based microservices connected via ESB and iPaaS (where enterprises are currently headed). Full microservices: A complete microservices architecture where each business function runs as a compartmentalized, yet integrated service (the future).
Thus, the concept of an ESB as an architectural pattern is certainly not dead. Instead, it has been resurrected with new names and counterparts. In fact, it is more relevant than ever before and part of the future hybrid integration architectures.
The main distinction between ESB and microservices is that an ESB is an integration tool, while microservices are just as the name suggests — small service components that are combined to create an application.
Microservices are initially the less productive architecture due to maintenance overhead. As the monolith grows, it gets more complex, and it's harder to add new features.
I've witnessed two ESB rollouts at different companies, in both cases with the same noble goals of just helping with some monitoring and authentication, providing "better" access to legacy systems. In both cases in just 1-2 years the ESB became a single point of failure, a bottleneck for change, and generally a roadblock for all projects.
ESBs are just too convenient not to use them. First, you'll just add some special routing for a message you want to send to some system, then you just quickly solve translating some xml message to another format, because you can. Then you add some more XSLTs or whatever to cover for a version update that would be too expensive to fix in the client system. And so on...
Before long, you will have business logic on there. All teams will have to coordinate with the ESB team for all rollouts, new messages or even changes in message formats. It will kill the independence (the low coupling) of your teams.
The point of the Microservices architecture, as you pointed out, is to enable autonomous operation not just for the service, but for its team as well. This enables quick change. Ideally this would mean:
Basically, you should be able to keep operating your microservice (and roll out new versions) even if the rest of the company shut theirs down and went on vacation.
Of course that is an "idealized" scenario, but an ESB most definitely goes against all goals above. It is a synchronization point, a centralized dependency both runtime and organizationally.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With