Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why ESB is considered bad in microservices architecture [closed]

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

  • Low coupling
  • High cohesion

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?

like image 477
Tuomas Toivonen Avatar asked Feb 21 '18 07:02

Tuomas Toivonen


People also ask

Can ESB be used with microservices?

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).

Is ESB outdated?

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.

What is the difference between ESB and microservices?

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.

What is bad about microservices?

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.


1 Answers

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:

  • Avoid any synchronization points with other teams, be it for testing, rollout, configuration or operation (i.e. you have to go cross-functional and do DevOps, etc.)
  • Avoid synchronization points runtime with other services. This means avoiding synchronous calls regardless of technology. You should only do fire-and-forget, never request-response even if the response comes at later point in time.
  • Avoid dependencies to other teams. This means avoid code-sharing (of code that has business-logic or business-related objects)

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.

like image 60
Robert Bräutigam Avatar answered Oct 25 '22 00:10

Robert Bräutigam