SOA Pattern (#8): ESB (Enterprise Service Bus)
Join the DZone community and get the full member experience.Join For Free
by thomas rischbeck
what is the esb?
esb products emerged around 2002 from message-oriented middleware (mom). faced with market domination by ibm, mom vendors were the first to jumpstart the esb concept with the aim of developing a unique selling proposition. they added web service and eai capabilities on top of existing message broker capabilities, and with analyst support coined the term esb. esb was positioned as a low-cost alternative to eai and panacea for all integration needs – tell-tale signs of hype. unfortunately, the standards community was too late to get on the bandwagon. in the absence of standards guidance and the lack of a clear definition, each vendor interpreted esb to its advantage. as a result, comparing esbs is like comparing apples and oranges. no two products are compatible today—with severe consequences (in terms of vendor lock-in) for end users. sca promises alleviation here, and market forces play in the favor of users too, with significant consolidation, convergence and commoditization taking place.
pattern or product?
an esb can mean vastly different things to different people, and given the esb market, most people think of esb in terms of an esb product with which they are familiar. the essence of an esb can be much more easily grasped by talking about the esb as a pattern : the pattern of applying an intermediate proxy to service communication. the esb pattern is about performing integration tasks and adding value to client-service communication in an soa – all completely transparent to the participants. as described in soa design patterns , the esb is a compound pattern that pulls together many enablement and enforcement capabilities that come in handy to the soa practitioner (see diagram below).
reliable messaging , message manipulation, data format and data model transformation as well as protocol bridging are just some sub-pattern examples under the esb umbrella. these are all enablement aspects where the esb allows communication between endpoints not possible otherwise. the esb can also restrict communication and enforce policies relating to security (such as authentication and coarse-grain authorization), sla monitoring, message inspection, intermediate validation and service governance. having said that we treat esb as a pattern and product type, synonymously.
modern esb vs. traditional esb
the traditional esb was positioned as the enterprise integration backbone and as a fundamental building block for an soa. pundits touted the esb as the “last middleware” that would gradually grow; instead of a big-bang replacement, segments would be added to the esb and applications added step-by-step until soa bliss: i.e., every stove-pipe application exposed as a service on the esb or on-ramped as a client. it was the easy path to soa – or so it seemed.
however, the vision of a single-vendor, enterprise-wide and infinitely scalable integration backbone remained a pipe dream. many enterprises soon had two or more esb products in house that now needed to be integrated somehow; company-wide data models proved elusive.
the modern esb accepts heterogeneity as a fact of life. it supports and embraces the domain inventory pattern. a domain is internally highly cohesive and externally largely autonomous from other domains. the esb supports domain-internal communication by mapping protocols and connecting via adapters into legacy applications. inter-domain communication does occur occasionally. the esb can model the external “cell membrane” of the domain, exposing a select few endpoints to other domains. it can normalize these endpoints in terms of data model, protocol binding and security models, therefore simplifying inter-domain communication. the modern esb is also lightweight, modular and builds on standards, such as sca, to avoid vendor lock-in.
one obvious alternative to using an esb is to not use one. “smart” endpoints could communicate in peer-to-peer fashion and use a standard protocol for addressing all functional and non-functional capabilities (such as soap and ws*). all endpoints must then support the same data model and provide lots of capabilities. consider reliable messaging: trapped messages, persistence, redeliveries, queue sizes, dead letter queues, etc. are just some aspects that must be controlled and monitored in a decentralized fashion. and this is just for the reliable messaging capability! david chappell coined the term “application servers everywhere” and lamented the operational overheads associated with this approach. while smart endpoints can work if there are few of them, they can lead to uncontrollable service sprawl and spaghetti-connections in the long run. malicious and invalid payloads can only be detected by the endpoint itself in this scheme – rarely a best practice and something discouraged by the multi-layer security pattern.
another alternative is the provision of standalone infrastructure services. integration capabilities are then implemented as and when needed (for example with a message broker). no investment in an esb is necessary and no unused capabilities exist. when further requirements come up (such as transformation, protocol bridging, adapters, etc.) they can be provisioned with additional standalone infrastructure services. again, such an approach can be very practicable in a small service portfolio. for larger deployments the installation, configuration and operation of the various standalone infrastructure services can become challenging. frequently you want to combine various integration capabilities. the esb can do so declaratively using the microflow pattern – various integration aspects can be arranged, combined and modified in a very agile manner. microflow s are performant because of internal optimization (not every capability is a first-class service invocation). from a maintenance, agility and performance point of view, standalone infrastructure services therefore draw the short straw.
the soa pattern of the week series is comprised of original content and insights provided to you courtesy of the authors and contributors of the soapatterns.org community site and the book “soa design patterns” (erl et al., isbn: 0136135161, prentice hall, 2009), the latest title in the prentice hall service-oriented computing series from thomas erl ( www.soabooks.com ).
Opinions expressed by DZone contributors are their own.