You are on page 1of 25

How do Async APIs Survive

in a REST World?

Luca Ferrari
EMEA Solution Architect

1
Past and present

Some of the topics I recently presented about:

Luca Ferrari
3scale ...
2 now Red Hat ...
now IBM
What is Async API ?

The model

3
Why Async APIs ?

from …

4
Why Async APIs ?

… to

5
Why Async APIs ?

example: Kafka

Kafka Strengths:
● Real Time Data Pipeline
● High-throughput
● Fault-tolerant
● Low Latency 
● Scalability 

Kafka Limits:
Kafka is not optimized to provide API consumers with friendly access to real time data.
Difficult to expose and re-use API oriented tools for Kafka

6
Why Async APIs ?

example: Kafka

Kafka Strengths:
● Real Time Data Pipeline
● High-throughput
● Fault-tolerant
● Low Latency 
● Scalability 

Kafka Limits:
Kafka is not optimized to provide API consumers with friendly access to real time data.
Difficult to expose and re-use API oriented tools for Kafka

7
What is AsyncAPI ?

AsyncAPI and Open API Spec

● AsyncAPI - derived from OpenAPI

● Similarities:
○ Definitions - similar schemas
○ Well-defined set of operations (HTTP methods vs publish/subscribe)
○ Similar security models for web interactions

● Differences
○ Semantic differences between clients (publisher/subscriber vs
client/server)
○ Different concepts (e.g. cookies)
○ Different data payloads

8
Why AsyncAPI ?

Features

❖ Being able to describe:


➢ Event-driven microservices
➢ IoT APIs
➢ Streaming APIs

❖ Some supported protocols:


➢ MQTT ➢ Stomp
➢ AMQP ➢ NATS
➢ WebSocket ➢ HTTP
➢ Kafka ➢ JMS
9
Kafka condensed

All the moving parts

10
REST or ASYNC ?

Request-reply vs. event-driven

Synchronous & ephemeral Asynchronous and persistent


Low composability Decoupled
Low tolerance to failure Highly composable
Best practices evolved as REST High tolerance to failure
Best practices are still evolving

11
REST and ASYNC !

Common concerns

● API contracts
○ Differentiated levels of service
○ Security: who can consume what topic, what operation

● Ease of consumption
○ Search a catalog of Topics, labels
○ ‘Try it out’s for data formats

● Monitoring, Analytics

● Monetization
○ What to price?
○ Who does what today?

12
Demo !

13
Demo setup

HTML5
page

14
Demo setup

HTML5
API
page
Gateway

15
Demo setup

HTML5
API
page
Gateway

API
Manager

16
Demo setup

HTML5
API HTTP
page
Gateway Bridge
AMQ
Streams

API
Manager

17
Demo setup

HTML5
API HTTP
page
Gateway Bridge
AMQ
Streams

API
Manager

18
Demo setup

HTML5
API HTTP
page
Gateway Bridge
AMQ
Streams AsyncAPI

API
Manager

19
Demo setup

HTML5
API HTTP
page
Gateway Bridge
AMQ
Streams AsyncAPI

API
Manager
NodeJS
client

20
Demo setup

Producer

HTML5
API HTTP
page
Gateway Bridge
AMQ
Streams AsyncAPI

Consumer

API
Manager
NodeJS
client

21
Demo setup

HTML5
API HTTP
page
Gateway Bridge
AMQ
Streams AsyncAPI

API
Manager

NodeJS
client
OpenShift Container Platform

22
Closing

Takeaway notes

▸ Difference between Sync and Async APIs


▸ Objective of AsyncAPI project
▸ Sync and Async APIs can play together

23
Closing

Takeaway notes

▸ Difference between Sync and Async APIs


▸ Objective of AsyncAPI project
▸ Sync and Async APIs can play together

Go out and be part of the community !

https://github.com/strimzi https://github.com/asyncapi

24
Thank you linkedin.com/company/red-hat

youtube.com/user/RedHatVideos
Red Hat is the world’s leading provider of enterprise

open source software solutions. Award-winning


facebook.com/redhatinc
support, training, and consulting services make

Red Hat a trusted adviser to the Fortune 500.


twitter.com/RedHat

25

You might also like