DX, API Design & Documentation

EventDriven APIs – Why REST isn’t Enough

Image by Gerd Altmann from Pixabay
234views

Steve Chan is a Senior Solution Engineer at Solace. In this article, he discusses why REST APIs may not be enough.

APIs tend to be request-response. So, you call an API and then wait for an answer to come back to you. One more form of API is the “Push.” This is where instead of you asking, you are told when something changes. These are “Event” or “Asynchronous” APIs. Gartner also thinks REST is insufficient; you need to be Event-Native.

Earlier, we considered the database the center of our tech universe. Everything revolves around the database, your services, applications, etc. But in event-native, our tech systems need to revolve around events.

Connected cars fleet, real-time trading, real-time inventory, and industrial maintenance using robots all need a push service instead of a pull service and are event-driven.

Solace has an “event mesh.” An event mesh is like a central nervous system where all your asynchronous events can flow throughout your enterprise and beyond it to your partners, customers, devices, and IoT devices, all in a seamless mesh.

An event mesh consists of events that are flowing, and these are tagged like hashtags. For example, if I’m only interested in payment events in Singapore, I can only subscribe to those events.

So, business processes are streams of events. They are an occurrence or a state change. An event topic or hashtag can be described as a combination of Nouns, Verbs, and Metadata.

An event-driven API is an asynchronous API, where instead of you doing a request and replying, the system pushes the information to you asynchronously. REST API is good for when you want to query something. It is good for peer-to-peer data exchange or passing of control.

Event-driven API is useful when you want to distribute information to many things simultaneously, e.g., flight information can be pushed to multiple taxi companies when it lands so that they can be available for rides. This can be monetized.

Managing both is the key to success – You need to manage both synchronous and async APIs in the same tools you’re used to.

Let us look at a simple use case. A customer places an order on your website. The first interaction is a request because you want to pick up order details. But inventory, shipping, etc., can be async or event-driven. The real world consists of sync and async interactions.

We must manage these events as products. These are called event-API products. This lets you package events as asynchronous APIs that you can monetize. You can bundle these event APIs that you can push to your partners or customers, and they’re managed with your existing API management technologies. You can curate and expose high-value, real-time data for rapid decision-making. Innovate and personalize offers based on evolving customer needs.

Event management is similar to API management. There is a catalog. You must let your consumers discover these APIs. You must share, reuse, analyze, and version them. The difference is with event-driven APIs; you need an event broker to push these events out. Your API consumers are not concerned if they are RESTful or event-driven APIs. They need to be able to discover them, use them, and configure them from the same place. That’s the secret of its success.

Solace has a tool called the “Event Portal,” which allows you to manage these events, whether the events come from Kafka, Solace, or other brokers; you can manage, govern, and catalog all these events in the same place in the Solace event portal.

Steve Chan
As a Senior Solution Engineer, Steve helps Solace clients design event-driven systems that meet their business and technical requirements in way that’s cost- and resource-efficient and can be easily adapted to meet new needs over time. Steve has been helping customers design event-driven systems for over 25 years, most recently with Confluent and with TIBCO for two decades before that. He holds a degree from the University of Sydney, and several AWS, Confluent and Solace certifications.

APIdays | Events | News | Intelligence

Attend APIdays conferences

The Worlds leading API Conferences:

Singapore, Zurich, Helsinki, Amsterdam, San Francisco, Sydney, Barcelona, London, Paris.

Get the API Landscape

The essential 1,000+ companies

Get the API Landscape
Industry Reports

Download our free reports

The State Of Api Documentation: 2017 Edition
  • State of API Documentation
  • The State of Banking APIs
  • GraphQL: all your queries answered
  • APIE Serverless Architecture