Why ESB is considered bad in microservices architecture [closed]
Asked Answered
A

1

18

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?

Alarick answered 21/2, 2018 at 7:45 Comment(5)
"The communication may be synchronous (orchestration) or event-based (choreography)" - this is not true, synchronous/event-based are orthogonal to orchestration/choreographyBiofeedback
What you mean??Alarick
I mean that you can have orchestration with an event-based architecture.Biofeedback
Haven't seen any source saying that ESB is a bad idea for microservice based architecture. The question doesn't have any particular points on “bad sides” of ESB. @TuomasToivonen any links on particular people/articles?Deliadelian
"it is highly discouraged ..." : citation needed.Ulna
J
32

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.

Jamille answered 21/2, 2018 at 9:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.