2020-06-08T17:30:00Z

What is the difference between an API Gateway and ESB?


Can you explain the differences between API Gateways and ESBs? What considerations are there for a business choose one over the other?

Guest
77 Answers

author avatar
Top 5LeaderboardReal User

ESB
Centralization of integration and the mediation of payloads are the main reasons why many organizations with Enterprise Resource Planning applications decided on an ESB "Enterprise Service Bus" for their organizations. With a multitude of connections protocols like JDBC, SFTP, JMS, REST, SOAP, and HTTPS there is not an application that some of these ESB's are not able to connect to. It has the ease of connectivity and the ability to handle the transformation of any data structure regardless of the data formats. An example of this would be to connect to APP 1 using SFTP to pick a file with CSV content and then transforming the CSV content to JSON content based on specific data mapping rules and forwarding the data to APP 2 using REST. Message persistence, Message Queening, Guaranteed Delivery are some of the other abilities. Asynchronous message processing is preferred over Synchronous message processing.

API
Most of the requirement for API's stems from the business wanting APPS for customers, simple integration with vendors and HR departments wanting apps to communicate to their employees. All this has to be achieved with agility, speed of execution, and is key to API calls which is why mapping of deep structured data to another data format is not advisable.
API management would be best suited in an organization with a SaaS 1st approach since most SaaS services have out of the box APIs. The key to the success of APIs is its ability to exchange data near real-time. Synchronous ( request-response ) exchange of data without data mediation is best suited for APIs.

In conclusion, API's is quick and easy away to consume data. While there is a need for an ERP solution it would make sense to have a native ESB and an API tool to call the backend without any data mediation.
A smaller organization who opt for SaaS is where API management is best suited.

2020-06-11T19:47:49Z
author avatar
User

ESB is enterprise service bus primarily to have an architecture where many systems can integrated with each other seamlessly, which means that there is away to just hookup any system be it legacy with the plugins that is provided by the products, this avoids point-to-point connections.
The primary duties of an ESB are:

1.Route messages between services
2.Monitor and control routing of message exchange between services
3.Resolve contention between communicating service components
4.Control deployment and versioning of services
5.Marshal use of redundant services
6.Provide commodity services like event handling, data transformation and mapping, message and event queuing and sequencing, security or exception handling, protocol conversion and enforcing proper quality of communication service.

API Gateway:

API Gateway is the main part of API management. We all know how and what APIs are and what the are used for. These can be small chunks of services or a large set of service having many operations, with APIs we do computation or some logic required to satisfy the incoming request, but these services when used by external users called consumers we need to bring in some kind of system which can manage the requests and response for that consumer.

For example, a consumer is looking for some service in a JSON format and gives the details on a different like firstName as FName etc. For the same if we change the API itself it would go redundant for another consumer who needs it in different way. Also, the API provider would want to see the traffic make sure there is a regulation on the traffic that comes in, change for the requests that are made or see the trend of each call made or check on the TPS,Not only that, can have a way to display the services that are available to be consumed.

API gateway is the answer to all these in addition to it gives a way to do the below:
Authentication
Security policy enforcement
Traffic Management policies
Load balancing
Dependency resolution
Cache management

For a business to choose between the both is the need of what kind of service is required, below set of questions might help to decide the same:

1. Is the purpose to provide a service to be consumed? - API Gateway
2. Is the purpose to integrate two different systems which cannot otherwise talk to each other - ESB
3.Is the purpose to do aggregations and mediation which involves logic - ESB
4. Is the purpose only to manage the incoming service request and do basic validation, security, threat protection,authentication? - API gateway
5. Is the purpose to provide a layer on top of your underlying API services? - API gateway

2020-06-11T06:08:41Z
author avatar
User

API GATEWAY

An API gateway is an API management tool that sits between a client and a collection of backend services. An API gateway acts as a reverse proxy to accept all application programming interface (API) calls, aggregate the various services required to fulfill them, and return the appropriate result.

ESB

An Enterprise Service Bus (ESB) is fundamentally an architecture. It is a set of rules and principles for integrating numerous applications together over a bus-like infrastructure. ... This decouples systems from each other, allowing them to communicate without dependency on or knowledge of other systems on the bus.

An ESB is a centralized middleware platform that is used to integrate various enterprise systems and applications. ESBs replace the need for point-to-point communication, which is highly complex and not easily scalable.

Which is the Right Choice for Business?

Both API management solutions and ESBs have a common purpose: closer integration between various systems, applications, and data. However, the similarities stop there. In general, API gateways are more agile and flexible, making them better suited for the modern enterprise IT landscape.

Going with an ESB is probably the best route for your company if:

Many of your systems and applications remain on-premises.

You’re mainly concerned with your internal systems, not external third-party integrations.

You prefer a more logical, “exposure-centric” model.

Using an API manager is likely the better choice for your company if:

You need access to features and functionality not available with ESBs.

You want a more flexible solution that is better suited for e.g. microservices architectures.

You prefer a more agile, “consumption-centric” model.

ESB vs. API

An API Gateway is a proxy provided for the client. The Gateway gives the client a consistent interface regardless of any changes within the internal system. It allows the internal system to change without affecting the client. 
The API Gateway can also provide consistent cross-cutting concerns such as security logging, reporting and API analytics.

An ESB (Enterprise Service Bus) provides a means for service-to-service communication. With this technique, services do not need to communicate with each other, reducing coupling. 

API management tools often have additional features and capabilities that are not present with an ESB.

API management is more flexible and optimized for newer tech developments such as microservices, whereas ESBs are not.

API management solutions are typically consumption-based, while ESBs have an exposure-based model.

ESB is traditional middleware used in SOA solutions for routing, message transformation, protocol bridging, among other things. A new category of middleware solutions called API Gateway are now offered by several vendors. These solutions are commonly described as the central point to access the REST and SOAP services offered publicly by an organization. However, API Gateway solutions seem to offer a subset of typical ESB features.

Today, the Service Mesh pattern has become popular for microservices. A Service Mesh implementation can provide both an API Gateway and service-to-service communication, along with load balancing, security and many other features.

2020-06-11T04:13:37Z
author avatar
Top 20Real User

An API gateway is something that typically acts as a proxy for your web services and provides interesting value, such as: logging, making SOAP services callable like REST services, debugging help, tracing, etc... Because the API gateway is a sitting between the consumer and your services, it can easily capture traffic and do these sorts of things

An Enterprise Service Bus (like nServiceBus) is designed to sit on top of a messaging protocol (like RabbitMQ) to give it functionality that does not come with (or functionality that is difficult to implement) the basic messaging or pub-sub, for example: Database stored durable messages, retry logic, listener encapsulation, easier ways to subscribe to messages, and sagas. You can use the messaging protocol without using an ESB but not the other way around. For example, you can use RabbitMQ without using nServiceBus.

2020-06-11T15:06:12Z
author avatar
User

An API gateway typically sits in the topmost layer of the northbound to accept all API requests coming in from Applications whether it be channels, third party trusted or non trusted servers. The API gateway has few key primary responsibilities such as :

* Authentication of the API request using PSK or tokens
* Throttling of the requests based on assigned quota or overall traffic handling capacity of the underlying application layers
* API registry management with structure interchangeability (XML to JSON to WSDL etc) support using Swagger
* Sandboxing of API.

Basically it would enable anything to do with the service API in its own form.

Sometimes it's also configured for advanced functions such as API Monetization, where the APIs are rated on a tariff and the registered API partners are invoiced for the usage..

An ESB sits South of API GW and has its own set of functions (although there are no standards specified) such as:
* Composition of the service API itself. i.e exposing a composite service API by combining or transforming multiple atomic service APIs from the underlying registered services
* Transformation of API (converting from one protocol to other or one structure to another)
* Routing of the API in one to one OR one to many forms
* Orchestration of the flow of services using some form of workflow implementation such as BPM
* And finally, enabling the publish and subscribe of these composite and atomic service APIs

In the microservices world as well, the ESB has a big role to play, unlike many theories that think otherwise. A layer that needs to organize all those millions of microservices getting created and enabling a meaningful composite structure for the external world to consume.. someone to maintain a registry so that duplicate development of a service is avoided within the same organization. Manageability of microservices.

2020-06-11T02:18:42Z
author avatar
User

The major difference is that API gateway exposes a set of services to consume. On the other hand, ESB s gives two-way relationships, so both service providers and consumers actively participate in terms of communication. Unlike API gateway, ESB allows the computation entity to be service as well as the consumer on-fly where gateways restrict the setup to have a single behavior.

An API Gateway is a proxy provided for the client. The Gateway gives the client a consistent interface regardless of any changes within the internal system. It allows the internal system to change without affecting the client. The API Gateway can also provide consistent cross-cutting concerns such as security logging, reporting and API analytics.

An ESB (Enterprise Service Bus) provides a means for service-to-service communication. With this technique, services do not need to communicate with each other, reducing coupling. ESBs often use guaranteed messaging for inter-service communication.

2020-06-10T22:54:31Z
author avatar
User

API Gateway is used for managing the APIs (like securing, publishing, subscribing etc for end-to-end management of APIs)
ESB is Enterprise Service Bus - helpful in integrating multiple applications in different format through message transformation, routing etc.

2020-06-11T11:36:13Z
Find out what your peers are saying about IBM, MuleSoft, Software AG and others in ESB. Updated: October 2020.
441,850 professionals have used our research since 2012.