With the advent of the modern digital enterprise, a focus on agility and scalability has been thrust into the forefront. Yet traditional software architectures fall short when it comes to supporting the sheer volume and speed at which data is generated.
Enterprises must find alternative solutions to enable a seamless flow of information in a secure and scalable fashion. In this article, we discuss the features of event-driven and API integration and how the combination of both creates a 1+1=3 relationship.
What is API Integration?
API integration refers to the connections between various applications and systems that allow organizations to automate business processes and enhance the sharing and embedding of data. APIs are a layer that goes between clients and services, acting as a central interface for clients utilizing microservices. Instead of clients sending requests directly to individual services, they are sent to an API gateway, which then passes the requests on to the appropriate service.
Besides acting as somewhat of a middleman, APIs also provide many other useful benefits including authentication (a client needing access to multiple services only needs to be authenticated once at the gateway), input validation (ensuring the client’s request contains all necessary information for completion), metrics collection/rate-limiting (measuring how many requests are sent to a particular microservice and limiting if necessary), and response transformation (augmenting data based on the device or source of request) just to name a few.
What is Event-Driven Integration?
In simple terms, event-driven integrations occur when an event (a predefined action or occurrence that is recognized by software) in one system triggers an action in another system. Consumers subscribe to events of interest and then receive notifications when the event occurs. This is in direct contrast to traditional APIs where consumers make requests to obtain the information they need.
There are three main components that make up event-driven integration, event producers (responsible for event generation), mediators/brokers (acts as the event distributor), and event processors/consumers (the recipients of said event). These components work in unison to effectively orchestrate incoming events and send them in the correct order to the different processors.
Better Together: Events and APIs
Although these models may seem to oppose each other at first sight, they are in fact complementary of each other. In a hybrid scenario where both APIs and EDI are used, the APIs leverage interactions where the applications require instantaneous feedback while events leverage asynchronous communications. This combination enables companies to allow their customers to take the best of both worlds and create powerful applications.
An example of this would be making API calls to create orders or initiate payments while using events to retrieve tracking updates after receiving an event notification. There are implementations of Event-Driven Architectures that deliver not only the notification itself but also the updated content. But even in this approach, an API could be triggered internally to retrieve the updates to be delivered to the subscribers of the event.
A Single Integrated Platform is a Necessity
In order to take full advantage of the benefits of both APIs and events, and build an application incorporating both, having one integrated platform to develop, deploy, and maintain the application is an absolute necessity for success. Vantiq CTO Paul Butterworth explains how event-driven systems work and what the Vantiq platform brings to the table in his whitepaper, Understanding Event-Driven Systems.