SlideShare uma empresa Scribd logo
1 de 40
Essential API Facade Patterns
Episode 4 – Synchronous to
Asynchronous Conversion



Santanu Dey                   Apigee
@Santanu_Dey                 @apigee
groups.google.com/group/api-craft
slideshare.net/apigee
youtube.com/apigee
@Santanu_Dey
 Santanu Dey
Webcast Series: API Facade Patterns

Episode 1
Composition

Episode 2
Session Management

Episode 3
One Phase to Two Phase Conversion

Episode 4
Synchronous to Asynchronous Conversion
Episode 4 : Synchronous to Asynchronous Conversion
Conversion


Problem
Solution
Benefits
Considerations
Problem




Conversion of asynchronous style APIs to synchronous

   To enable API teams and app developers to implement and
   improve their API designs and apps
Example of a Synchronous API




                       1. Request
                                       API
                                     Provider

                       2. Response
Client waits
for the response
Example of a Synchronous API

POST
http://example.com/smsmessaging/outbound/tel%3A%2B12345678/r
equests

{"outboundSMSMessageRequest":
        {
        "address":["tel:+13500000991”],
        "senderAddress":"tel:12345678",
        "outboundSMSTextMessage":
               {
               "message":"Hello World”
               },
        "senderName":"ACME Inc.”
        }
}
Example of a Synchronous API


Response:

HTTP/1.1 200

{"deliveryInfo":
         {
                 "address":"tel:+1350000991",
        "deliveryStatus":"DeliveredToNetwork”
                 }
        }
}
What are the Constructs of an Asynchronous API?
Example of an Asynchronous API


                     1. Request
  Client                                 API
                                       Provider
               Client does not wait
               for the completion of
               the process
Example of an Asynchronous API


                 1. Request

               Client does not wait
               for the completion       API
  Client
               of the process         Provider

                 2. Asynch Response

               Server calls back
Example of an Asynchronous API
POST
http://example.com/smsmessaging/outbound/tel%3A%2B12345678/r
equests
{"outboundSMSMessageRequest":
         {
         "address":["tel:+13500000991”],
         "senderAddress":"tel:12345678",
         "outboundSMSTextMessage":
                 {
                 "message":"Hello World”
                 },
         "senderName":"ACME Inc.”
         }
         "receiptRequest":
         {
                 "notifyURL":"http://…/notifications/",
                 "callbackData":”12345"},
}
Example of an Asynchronous API
Immediate Response:

HTTP/1.1 201

{"deliveryInfo":
         {
                 "address":"tel:+1350000991",
        "deliveryStatus":"MessageWaiting”
                 }
        }

        "receiptRequest":
        {
                "notifyURL":"http://…/notifications/",
                "callbackData":”12345"},
}
Example of an Asynchronous API
Asynch Call-back Response (A new request):

POST http://Client-app.example.com/notifications/
{
"deliveryInfoNotification":
  {
    "callbackData": "12345”,
    "deliveryInfo":

               {
                "address":"tel:+1350000991",
               "deliveryStatus":"DeliveredToNetwork"

               }
      }
}
The end-user facing application use-case may require
synchronous behavior
Having a call back URL from a client-application is not
feasible
Solution
Synch to Asynch



The solution is to introduce an API Façade in the middle
which can handle the conversion



                                               Asynch.
           Synch                  Asynch       Provider
Warning! UML Ahead
When the Target Does not Provide a Call Back


                    1. Request


                  Client does not wait
                  for the completion of
                                                 API
                  the process                  Provider


                    2. Check Status


                  Client checks for the
                  status later
Example of the API Façade


                          API Façade




                        API
                                    Existing     Backend
                     Exposure &
                                  Capabilities    Server
                       Mgmt.

App relies on REST
Benefits
The API Façade provides a secure & reliable call back host
Robust callback processing options in the API Façade
This pattern can be applied to mediate REST APIs to
asynchronous messaging transports such as JMS
Other Considerations
What is a good timeout for asynch to synch conversion?
Do not abandon the Asynchronous APIs
     • High throughput
     • Lower response-time
Provide Choice to Developers when Possible




If you really need a synch API -

Have a synchronous variation of the same API
alongside an asynchronous variation
Questions?
THANK YOU
Subscribe to API webcasts at:
youtube.com/apigee



                                 Apigee
                                @apigee
THANK YOU
Questions and ideas to:
groups.google.com/group/api-craft



                                     Apigee
                                    @apigee
THANK YOU
Contact me at:

@Santanu_Dey
sdey@apigee.com




                   Apigee
                  @apigee

Mais conteúdo relacionado

Mais procurados

11 Sistem Pendukung Keputusan
11 Sistem Pendukung Keputusan11 Sistem Pendukung Keputusan
11 Sistem Pendukung Keputusan
Ainul Yaqin
 
Introduction to couchbase
Introduction to couchbaseIntroduction to couchbase
Introduction to couchbase
Dipti Borkar
 

Mais procurados (20)

Project charter
Project charterProject charter
Project charter
 
Real-Time Event Processing
Real-Time Event ProcessingReal-Time Event Processing
Real-Time Event Processing
 
Communication in a Microservice Architecture
Communication in a Microservice ArchitectureCommunication in a Microservice Architecture
Communication in a Microservice Architecture
 
Military Aircraft Detection using Deep Learning model.
Military Aircraft Detection using Deep Learning model.Military Aircraft Detection using Deep Learning model.
Military Aircraft Detection using Deep Learning model.
 
Event driven architecture
Event driven architectureEvent driven architecture
Event driven architecture
 
Event Driven Microservices architecture
Event Driven Microservices architectureEvent Driven Microservices architecture
Event Driven Microservices architecture
 
CLOUD ARCHITECTURE AND SERVICES.pptx
CLOUD ARCHITECTURE AND SERVICES.pptxCLOUD ARCHITECTURE AND SERVICES.pptx
CLOUD ARCHITECTURE AND SERVICES.pptx
 
Workshop on Google Cloud Data Platform
Workshop on Google Cloud Data PlatformWorkshop on Google Cloud Data Platform
Workshop on Google Cloud Data Platform
 
Cloud computing and data security
Cloud computing and data securityCloud computing and data security
Cloud computing and data security
 
Security in cloud computing
Security in cloud computingSecurity in cloud computing
Security in cloud computing
 
11 Sistem Pendukung Keputusan
11 Sistem Pendukung Keputusan11 Sistem Pendukung Keputusan
11 Sistem Pendukung Keputusan
 
Creating UDP Broadcast App Using Python Socket on WIndows & Linux
Creating UDP Broadcast App Using Python Socket on WIndows & LinuxCreating UDP Broadcast App Using Python Socket on WIndows & Linux
Creating UDP Broadcast App Using Python Socket on WIndows & Linux
 
cloud computing basics
cloud computing basicscloud computing basics
cloud computing basics
 
Manajemen proyek
Manajemen proyekManajemen proyek
Manajemen proyek
 
manajemen Proyek perangkat Lunak
manajemen Proyek perangkat Lunakmanajemen Proyek perangkat Lunak
manajemen Proyek perangkat Lunak
 
CLOUD COMPUTING AND STORAGE
CLOUD COMPUTING AND STORAGECLOUD COMPUTING AND STORAGE
CLOUD COMPUTING AND STORAGE
 
Task programming
Task programmingTask programming
Task programming
 
Introducing Change Data Capture with Debezium
Introducing Change Data Capture with DebeziumIntroducing Change Data Capture with Debezium
Introducing Change Data Capture with Debezium
 
Introduction to couchbase
Introduction to couchbaseIntroduction to couchbase
Introduction to couchbase
 
COMPUTER SYSTEM ENGINEERING
COMPUTER SYSTEM ENGINEERINGCOMPUTER SYSTEM ENGINEERING
COMPUTER SYSTEM ENGINEERING
 

Destaque

Essential API Facade Patterns: One Phase to Two Phase Conversion (Episode 3)
Essential API Facade Patterns: One Phase to Two Phase Conversion (Episode 3)Essential API Facade Patterns: One Phase to Two Phase Conversion (Episode 3)
Essential API Facade Patterns: One Phase to Two Phase Conversion (Episode 3)
Apigee | Google Cloud
 
Skeuomorphs, Databases, and Mobile Performance
Skeuomorphs, Databases, and Mobile PerformanceSkeuomorphs, Databases, and Mobile Performance
Skeuomorphs, Databases, and Mobile Performance
Apigee | Google Cloud
 
HTML5: The Apps, the Frameworks, the Controversy
HTML5: The Apps, the Frameworks, the Controversy HTML5: The Apps, the Frameworks, the Controversy
HTML5: The Apps, the Frameworks, the Controversy
Apigee | Google Cloud
 
Crafting APIs for Mobile Apps - Everything You Need to Know
Crafting APIs for Mobile Apps - Everything You Need to KnowCrafting APIs for Mobile Apps - Everything You Need to Know
Crafting APIs for Mobile Apps - Everything You Need to Know
Apigee | Google Cloud
 
Building your first Native iOs App with an API Backend
Building your first Native iOs App with an API BackendBuilding your first Native iOs App with an API Backend
Building your first Native iOs App with an API Backend
Apigee | Google Cloud
 
Driving Digital Success: Three ROI Criteria for Competitive Advantage
Driving Digital Success:  Three ROI Criteria for Competitive Advantage Driving Digital Success:  Three ROI Criteria for Competitive Advantage
Driving Digital Success: Three ROI Criteria for Competitive Advantage
Apigee | Google Cloud
 
The New 3-Tier Architecture: HTML5, Proxies, and APIs
The New 3-Tier Architecture: HTML5, Proxies, and APIsThe New 3-Tier Architecture: HTML5, Proxies, and APIs
The New 3-Tier Architecture: HTML5, Proxies, and APIs
Apigee | Google Cloud
 
Essential API Facade Patterns: Session Management (Episode 2)
Essential API Facade Patterns: Session Management (Episode 2)Essential API Facade Patterns: Session Management (Episode 2)
Essential API Facade Patterns: Session Management (Episode 2)
Apigee | Google Cloud
 
APIs Inside Enterprise - SOA Displacement?
APIs Inside Enterprise - SOA Displacement?APIs Inside Enterprise - SOA Displacement?
APIs Inside Enterprise - SOA Displacement?
Apigee | Google Cloud
 
Telco Innovation with APIs - Need for speed (Webcast)
Telco Innovation with APIs - Need for speed (Webcast) Telco Innovation with APIs - Need for speed (Webcast)
Telco Innovation with APIs - Need for speed (Webcast)
Apigee | Google Cloud
 
DevOps & Apps - Building and Operating Successful Mobile Apps
DevOps & Apps - Building and Operating Successful Mobile AppsDevOps & Apps - Building and Operating Successful Mobile Apps
DevOps & Apps - Building and Operating Successful Mobile Apps
Apigee | Google Cloud
 
Economic Models for Reinventing Telco - Innovation with APIs
Economic Models for Reinventing Telco - Innovation with APIsEconomic Models for Reinventing Telco - Innovation with APIs
Economic Models for Reinventing Telco - Innovation with APIs
Apigee | Google Cloud
 
API Management for Software Defined Network (SDN)
API Management for Software Defined Network (SDN)API Management for Software Defined Network (SDN)
API Management for Software Defined Network (SDN)
Apigee | Google Cloud
 

Destaque (20)

Essential API Facade Patterns: One Phase to Two Phase Conversion (Episode 3)
Essential API Facade Patterns: One Phase to Two Phase Conversion (Episode 3)Essential API Facade Patterns: One Phase to Two Phase Conversion (Episode 3)
Essential API Facade Patterns: One Phase to Two Phase Conversion (Episode 3)
 
API Façade Pattern
API Façade PatternAPI Façade Pattern
API Façade Pattern
 
Skeuomorphs, Databases, and Mobile Performance
Skeuomorphs, Databases, and Mobile PerformanceSkeuomorphs, Databases, and Mobile Performance
Skeuomorphs, Databases, and Mobile Performance
 
HTML5: The Apps, the Frameworks, the Controversy
HTML5: The Apps, the Frameworks, the Controversy HTML5: The Apps, the Frameworks, the Controversy
HTML5: The Apps, the Frameworks, the Controversy
 
The Anatomy of Apps - How iPhone, Android & Facebook Apps Consume APIs
The Anatomy of Apps - How iPhone, Android & Facebook Apps Consume APIsThe Anatomy of Apps - How iPhone, Android & Facebook Apps Consume APIs
The Anatomy of Apps - How iPhone, Android & Facebook Apps Consume APIs
 
Visbility at the Edge - Deep Insights from Your API
 Visbility at the Edge - Deep Insights from Your API Visbility at the Edge - Deep Insights from Your API
Visbility at the Edge - Deep Insights from Your API
 
The API Facade Pattern: People - Episode 4
The API Facade Pattern: People - Episode 4The API Facade Pattern: People - Episode 4
The API Facade Pattern: People - Episode 4
 
Crafting APIs for Mobile Apps - Everything You Need to Know
Crafting APIs for Mobile Apps - Everything You Need to KnowCrafting APIs for Mobile Apps - Everything You Need to Know
Crafting APIs for Mobile Apps - Everything You Need to Know
 
Building your first Native iOs App with an API Backend
Building your first Native iOs App with an API BackendBuilding your first Native iOs App with an API Backend
Building your first Native iOs App with an API Backend
 
Driving Digital Success: Three ROI Criteria for Competitive Advantage
Driving Digital Success:  Three ROI Criteria for Competitive Advantage Driving Digital Success:  Three ROI Criteria for Competitive Advantage
Driving Digital Success: Three ROI Criteria for Competitive Advantage
 
The API Facade Pattern: Common Patterns - Episode 2
The API Facade Pattern: Common Patterns - Episode 2The API Facade Pattern: Common Patterns - Episode 2
The API Facade Pattern: Common Patterns - Episode 2
 
The New 3-Tier Architecture: HTML5, Proxies, and APIs
The New 3-Tier Architecture: HTML5, Proxies, and APIsThe New 3-Tier Architecture: HTML5, Proxies, and APIs
The New 3-Tier Architecture: HTML5, Proxies, and APIs
 
Essential API Facade Patterns: Session Management (Episode 2)
Essential API Facade Patterns: Session Management (Episode 2)Essential API Facade Patterns: Session Management (Episode 2)
Essential API Facade Patterns: Session Management (Episode 2)
 
The Walgreens Story: Putting an API Around Their Stores (Webcast)
The Walgreens Story: Putting an API Around Their Stores (Webcast)The Walgreens Story: Putting an API Around Their Stores (Webcast)
The Walgreens Story: Putting an API Around Their Stores (Webcast)
 
APIs Inside Enterprise - SOA Displacement?
APIs Inside Enterprise - SOA Displacement?APIs Inside Enterprise - SOA Displacement?
APIs Inside Enterprise - SOA Displacement?
 
Telco Innovation with APIs - Need for speed (Webcast)
Telco Innovation with APIs - Need for speed (Webcast) Telco Innovation with APIs - Need for speed (Webcast)
Telco Innovation with APIs - Need for speed (Webcast)
 
DevOps & Apps - Building and Operating Successful Mobile Apps
DevOps & Apps - Building and Operating Successful Mobile AppsDevOps & Apps - Building and Operating Successful Mobile Apps
DevOps & Apps - Building and Operating Successful Mobile Apps
 
Economic Models for Reinventing Telco - Innovation with APIs
Economic Models for Reinventing Telco - Innovation with APIsEconomic Models for Reinventing Telco - Innovation with APIs
Economic Models for Reinventing Telco - Innovation with APIs
 
API Management for Software Defined Network (SDN)
API Management for Software Defined Network (SDN)API Management for Software Defined Network (SDN)
API Management for Software Defined Network (SDN)
 
OData Introduction and Impact on API Design (Webcast)
OData Introduction and Impact on API Design (Webcast)OData Introduction and Impact on API Design (Webcast)
OData Introduction and Impact on API Design (Webcast)
 

Semelhante a Essential API Facade Patterns: Synchronous to Asynchronous Conversion (Episode 4)

Azure APIM Presentation to understand about.pptx
Azure APIM Presentation to understand about.pptxAzure APIM Presentation to understand about.pptx
Azure APIM Presentation to understand about.pptx
pythagorus143
 
AWS July Webinar Series - Overview Build and Manage your APs with amazon api ...
AWS July Webinar Series - Overview Build and Manage your APs with amazon api ...AWS July Webinar Series - Overview Build and Manage your APs with amazon api ...
AWS July Webinar Series - Overview Build and Manage your APs with amazon api ...
Amazon Web Services
 

Semelhante a Essential API Facade Patterns: Synchronous to Asynchronous Conversion (Episode 4) (20)

REST to JavaScript for Better Client-side Development
REST to JavaScript for Better Client-side DevelopmentREST to JavaScript for Better Client-side Development
REST to JavaScript for Better Client-side Development
 
Introduction to AWS API Gateway Presentation
Introduction to AWS API Gateway PresentationIntroduction to AWS API Gateway Presentation
Introduction to AWS API Gateway Presentation
 
Plataforma distribuída de Microserviços ou, como a Olist funciona
Plataforma distribuída de Microserviços ou, como a Olist funcionaPlataforma distribuída de Microserviços ou, como a Olist funciona
Plataforma distribuída de Microserviços ou, como a Olist funciona
 
Operating your Production API
Operating your Production APIOperating your Production API
Operating your Production API
 
Building Scalable Services with Amazon API Gateway - Technical 201
Building Scalable Services with Amazon API Gateway - Technical 201Building Scalable Services with Amazon API Gateway - Technical 201
Building Scalable Services with Amazon API Gateway - Technical 201
 
Designing Fault Tolerant APIs to keep Application Network Intact | MuleSoft M...
Designing Fault Tolerant APIs to keep Application Network Intact | MuleSoft M...Designing Fault Tolerant APIs to keep Application Network Intact | MuleSoft M...
Designing Fault Tolerant APIs to keep Application Network Intact | MuleSoft M...
 
Releasing Software Quickly and Reliably With AWS CodePipeline by Mark Mansour...
Releasing Software Quickly and Reliably With AWS CodePipeline by Mark Mansour...Releasing Software Quickly and Reliably With AWS CodePipeline by Mark Mansour...
Releasing Software Quickly and Reliably With AWS CodePipeline by Mark Mansour...
 
Azure APIM Presentation to understand about.pptx
Azure APIM Presentation to understand about.pptxAzure APIM Presentation to understand about.pptx
Azure APIM Presentation to understand about.pptx
 
Aws Technical Day 2015 - Amazon API Gateway
Aws Technical Day 2015 - Amazon API GatewayAws Technical Day 2015 - Amazon API Gateway
Aws Technical Day 2015 - Amazon API Gateway
 
Amazon API Gateway
Amazon API GatewayAmazon API Gateway
Amazon API Gateway
 
AWS August Webinar Series - Building Serverless Backends with AWS Lambda and ...
AWS August Webinar Series - Building Serverless Backends with AWS Lambda and ...AWS August Webinar Series - Building Serverless Backends with AWS Lambda and ...
AWS August Webinar Series - Building Serverless Backends with AWS Lambda and ...
 
Migrate your Existing Express Apps to AWS Lambda and Amazon API Gateway
Migrate your Existing Express Apps to AWS Lambda and Amazon API GatewayMigrate your Existing Express Apps to AWS Lambda and Amazon API Gateway
Migrate your Existing Express Apps to AWS Lambda and Amazon API Gateway
 
REST APIs
REST APIsREST APIs
REST APIs
 
AWS July Webinar Series: Overview: Build and Manage your APIs with Amazon API...
AWS July Webinar Series: Overview: Build and Manage your APIs with Amazon API...AWS July Webinar Series: Overview: Build and Manage your APIs with Amazon API...
AWS July Webinar Series: Overview: Build and Manage your APIs with Amazon API...
 
AWS July Webinar Series - Overview Build and Manage your APs with amazon api ...
AWS July Webinar Series - Overview Build and Manage your APs with amazon api ...AWS July Webinar Series - Overview Build and Manage your APs with amazon api ...
AWS July Webinar Series - Overview Build and Manage your APs with amazon api ...
 
Azure API Management - why should I care?
Azure API Management - why should I care?Azure API Management - why should I care?
Azure API Management - why should I care?
 
Why your next serverless project should use AWS AppSync
Why your next serverless project should use AWS AppSyncWhy your next serverless project should use AWS AppSync
Why your next serverless project should use AWS AppSync
 
A Practical Guide to Automating End-to-End API Testing
A Practical Guide to Automating End-to-End API TestingA Practical Guide to Automating End-to-End API Testing
A Practical Guide to Automating End-to-End API Testing
 
WSO2 MASTER CLASS ITALIA #11 - APIM 4.0 & approccio event based
WSO2 MASTER CLASS ITALIA #11 - APIM 4.0 & approccio event basedWSO2 MASTER CLASS ITALIA #11 - APIM 4.0 & approccio event based
WSO2 MASTER CLASS ITALIA #11 - APIM 4.0 & approccio event based
 
Build and Manage Your APIs with Amazon API Gateway
Build and Manage Your APIs with Amazon API GatewayBuild and Manage Your APIs with Amazon API Gateway
Build and Manage Your APIs with Amazon API Gateway
 

Mais de Apigee | Google Cloud

Mais de Apigee | Google Cloud (20)

How Secure Are Your APIs?
How Secure Are Your APIs?How Secure Are Your APIs?
How Secure Are Your APIs?
 
Magazine Luiza at a glance (1)
Magazine Luiza at a glance (1)Magazine Luiza at a glance (1)
Magazine Luiza at a glance (1)
 
Monetization: Unlock More Value from Your APIs
Monetization: Unlock More Value from Your APIs Monetization: Unlock More Value from Your APIs
Monetization: Unlock More Value from Your APIs
 
Apigee Demo: API Platform Overview
Apigee Demo: API Platform OverviewApigee Demo: API Platform Overview
Apigee Demo: API Platform Overview
 
Ticketmaster at a glance
Ticketmaster at a glanceTicketmaster at a glance
Ticketmaster at a glance
 
AccuWeather: Recasting API Experiences in a Developer-First World
AccuWeather: Recasting API Experiences in a Developer-First WorldAccuWeather: Recasting API Experiences in a Developer-First World
AccuWeather: Recasting API Experiences in a Developer-First World
 
Which Application Modernization Pattern Is Right For You?
Which Application Modernization Pattern Is Right For You?Which Application Modernization Pattern Is Right For You?
Which Application Modernization Pattern Is Right For You?
 
Apigee Product Roadmap Part 2
Apigee Product Roadmap Part 2Apigee Product Roadmap Part 2
Apigee Product Roadmap Part 2
 
The Four Transformative Forces of the API Management Market
The Four Transformative Forces of the API Management MarketThe Four Transformative Forces of the API Management Market
The Four Transformative Forces of the API Management Market
 
Walgreens at a glance
Walgreens at a glanceWalgreens at a glance
Walgreens at a glance
 
Apigee Edge: Intro to Microgateway
Apigee Edge: Intro to MicrogatewayApigee Edge: Intro to Microgateway
Apigee Edge: Intro to Microgateway
 
Managing the Complexity of Microservices Deployments
Managing the Complexity of Microservices DeploymentsManaging the Complexity of Microservices Deployments
Managing the Complexity of Microservices Deployments
 
Pitney Bowes at a glance
Pitney Bowes at a glancePitney Bowes at a glance
Pitney Bowes at a glance
 
Microservices Done Right: Key Ingredients for Microservices Success
Microservices Done Right: Key Ingredients for Microservices SuccessMicroservices Done Right: Key Ingredients for Microservices Success
Microservices Done Right: Key Ingredients for Microservices Success
 
Adapt or Die: Opening Keynote with Chet Kapoor
Adapt or Die: Opening Keynote with Chet KapoorAdapt or Die: Opening Keynote with Chet Kapoor
Adapt or Die: Opening Keynote with Chet Kapoor
 
Adapt or Die: Keynote with Greg Brail
Adapt or Die: Keynote with Greg BrailAdapt or Die: Keynote with Greg Brail
Adapt or Die: Keynote with Greg Brail
 
Adapt or Die: Keynote with Anant Jhingran
Adapt or Die: Keynote with Anant JhingranAdapt or Die: Keynote with Anant Jhingran
Adapt or Die: Keynote with Anant Jhingran
 
London Adapt or Die: Opening Keynot
London Adapt or Die: Opening KeynotLondon Adapt or Die: Opening Keynot
London Adapt or Die: Opening Keynot
 
London Adapt or Die: Lunch keynote
London Adapt or Die: Lunch keynoteLondon Adapt or Die: Lunch keynote
London Adapt or Die: Lunch keynote
 
London Adapt or Die: Closing Keynote — Adapt Now!
London Adapt or Die: Closing Keynote — Adapt Now!London Adapt or Die: Closing Keynote — Adapt Now!
London Adapt or Die: Closing Keynote — Adapt Now!
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

Essential API Facade Patterns: Synchronous to Asynchronous Conversion (Episode 4)

  • 1. Essential API Facade Patterns Episode 4 – Synchronous to Asynchronous Conversion Santanu Dey Apigee @Santanu_Dey @apigee
  • 6. Webcast Series: API Facade Patterns Episode 1 Composition Episode 2 Session Management Episode 3 One Phase to Two Phase Conversion Episode 4 Synchronous to Asynchronous Conversion
  • 7. Episode 4 : Synchronous to Asynchronous Conversion Conversion Problem Solution Benefits Considerations
  • 8. Problem Conversion of asynchronous style APIs to synchronous To enable API teams and app developers to implement and improve their API designs and apps
  • 9. Example of a Synchronous API 1. Request API Provider 2. Response Client waits for the response
  • 10. Example of a Synchronous API POST http://example.com/smsmessaging/outbound/tel%3A%2B12345678/r equests {"outboundSMSMessageRequest": { "address":["tel:+13500000991”], "senderAddress":"tel:12345678", "outboundSMSTextMessage": { "message":"Hello World” }, "senderName":"ACME Inc.” } }
  • 11. Example of a Synchronous API Response: HTTP/1.1 200 {"deliveryInfo": { "address":"tel:+1350000991", "deliveryStatus":"DeliveredToNetwork” } } }
  • 12. What are the Constructs of an Asynchronous API?
  • 13. Example of an Asynchronous API 1. Request Client API Provider Client does not wait for the completion of the process
  • 14. Example of an Asynchronous API 1. Request Client does not wait for the completion API Client of the process Provider 2. Asynch Response Server calls back
  • 15. Example of an Asynchronous API POST http://example.com/smsmessaging/outbound/tel%3A%2B12345678/r equests {"outboundSMSMessageRequest": { "address":["tel:+13500000991”], "senderAddress":"tel:12345678", "outboundSMSTextMessage": { "message":"Hello World” }, "senderName":"ACME Inc.” } "receiptRequest": { "notifyURL":"http://…/notifications/", "callbackData":”12345"}, }
  • 16. Example of an Asynchronous API Immediate Response: HTTP/1.1 201 {"deliveryInfo": { "address":"tel:+1350000991", "deliveryStatus":"MessageWaiting” } } "receiptRequest": { "notifyURL":"http://…/notifications/", "callbackData":”12345"}, }
  • 17. Example of an Asynchronous API Asynch Call-back Response (A new request): POST http://Client-app.example.com/notifications/ { "deliveryInfoNotification": { "callbackData": "12345”, "deliveryInfo": { "address":"tel:+1350000991", "deliveryStatus":"DeliveredToNetwork" } } }
  • 18. The end-user facing application use-case may require synchronous behavior
  • 19. Having a call back URL from a client-application is not feasible
  • 21. Synch to Asynch The solution is to introduce an API Façade in the middle which can handle the conversion Asynch. Synch Asynch Provider
  • 23.
  • 24.
  • 25. When the Target Does not Provide a Call Back 1. Request Client does not wait for the completion of API the process Provider 2. Check Status Client checks for the status later
  • 26.
  • 27.
  • 28. Example of the API Façade API Façade API Existing Backend Exposure & Capabilities Server Mgmt. App relies on REST
  • 30. The API Façade provides a secure & reliable call back host
  • 31. Robust callback processing options in the API Façade
  • 32. This pattern can be applied to mediate REST APIs to asynchronous messaging transports such as JMS
  • 34. What is a good timeout for asynch to synch conversion?
  • 35. Do not abandon the Asynchronous APIs • High throughput • Lower response-time
  • 36. Provide Choice to Developers when Possible If you really need a synch API - Have a synchronous variation of the same API alongside an asynchronous variation
  • 38. THANK YOU Subscribe to API webcasts at: youtube.com/apigee Apigee @apigee
  • 39. THANK YOU Questions and ideas to: groups.google.com/group/api-craft Apigee @apigee
  • 40. THANK YOU Contact me at: @Santanu_Dey sdey@apigee.com Apigee @apigee

Notas do Editor

  1. Hello & Good morningWelcome to the Essential API Façade Patterns WebcastToday is Episode 4 , the last one of the series and we are going to discuss Synchronous to Asynchronous Conversion Façade Pattern.Thanks for joining us today
  2. In terms of relevant preparatory material you can checkout this fantastic community of API thinkers and doers on a google groups called API Crafthang out and feel free to share your thoughts on APIs
  3. The slides that we are going to be presenting today, the earlier slides of the series, and all other webiner slides of the past are available on slidesharePls go to slideshare.net/apigee
  4. This video and other videos of the webcast series will be available on youtubeWe have a youtube channel At youtube.com/apigee
  5. I am Santanu DeyI am a senior solution architect here at Apigee – I am love to work on Integration – primarily focused on API based Integration & I love APIs
  6. This webcast is the last one of a four part series on Essential API Façades PatternsToday we will talk about synchronous to asynchronous conversion patterns using API façade.
  7. Each of these web cast episodes are structured in four sectionsWill take about 20 minutes.
  8. What is the problem statement for this pattern? What is the best way convert an Asynchronous style API to synchronous REST API So that,Applications which consumes these APIs can implement the applications with ease and improved design to make the App-experincebetterFor API providers what is the right way to implement this conversion?“Conversion of Asynchronous style API to Synchronous” For REST APIs and Apps So that is our problem statement today
  9. Let us look at an example of REST style synchronous APIA client sends a request to the server over HTTPAnd then the client will wait for the server to respond back.Processing at the client end will be blocked for the server to respond. If the server does not respond back within a given timeframe, the client will stop waiting for that response. It is a “timeout”
  10. Let me elaborate on synchronous communication with a REST style Request / ResponseTake the example of a standard SMS API. A client application sends a short text message for a destination number to the server. This is the request. A POST request – In REST POST is used used for creating a resource in the server. For instance, SMS is the resource in this case.
  11. If the server is able to process and complete the request the response would look like a standard HTTP success response, with 200 response code,The payload or response body would suggest that the processing was completed. The SMS delivery status as “DeliveredToNetwork” indicates that In case of error scenarios like bad number of bad request you may expect a 400 HTTP response and so on.If the response tokes too long or because HTTP is unreliable there may be occasional connection issues such as data packet drops. In such cases the client would time out. But in case of success, creating the resource.
  12. In case of asynch API as usual the client originates a request.However it does not wait for the server to process the request and send back a response.
  13. The service provider may send back a response, later on, in a completely different service call invocation.The callback notification is then handled by the client.. To process further.From the perspective of the client – the notification can arrive at an out of sync time. It does not halt processing for the response.
  14. Again taking the SMS exampleThe request remains almost same. It is a post request to create the request on the server side.One important distinction here is to include the notification URL and an unique correlation id in the requestthat the response can be identified to be associated with a the original request.In stead of dynamic call back URLs it can also be based on a pre-defined contract.
  15. Because HTTP is itself synchronous Transport, there would have to be an immediate response, though the actual process of handling the SMS may not complete. So the immediate response would be more of an acknowledgement. Here the IMMEDIATE http response would just be a HTTP 201 which means the request was created, but the processing status is shown in the delibvery status
  16. Once the actual processing is completed. The server would respond back.Here the asynchronous response is a new call altogether. Back in to the notify URL of the client.
  17. i.e., the use case may require the user to wait for the response for before the next action – If we do not address that aspect it would lead to loss of user experienceFor user experience issue take this example Take the example of Booking a travel ticketThen booking a hotel stay.So this case the application experience can not Here the end-user application would have to wait for completion of the processing. If we take programmatic workarounds, that may lead to the situation where it may block main flow of the programIf one tries to work around, it might lead to thread management or asynchronous tasks in the client runtime.(If supported.) Code may become difficult to maintain / manage
  18. This is an obvious point.
  19. For the client the it is a single requestThe API Façade makes the necessary plumbing to address the asynchronous provider.
  20. I am going to use a UML sequence diagram to explain the responsibilities of the API Façade layer in this pattern.
  21. Point to consider here – time out till which the Façade layer will wait for a call back.Façade layer constructs and provides the call back URL…Façade waits for the responseIMPORTANT The API Façade layer when it receives the callback – it matches with the request correlator – that takes care of matching the request with response.
  22. What I have not shown in the previous diagram is that the API façade also waits for a time out period. When the time out fails – it responds back to the client with an error response. If the timeout is too long – the end user would have to wait too long for an API response. On the other hand if the timeout is too short in that case the target side may not be able to process the SMS delivery status within that period.
  23. There is a variation of this pattern. Let consider another way of implementing the asynchronous pattern.In this case the target system, the API provider does not
  24. Almost same flow like before. Except that in place of notification from the server, the consumer needs to check the status.
  25. In this case the Façade Layer will be polling for response. Polling frequency, retries are parameters to consider in the design. SO in two cases you may error outTime outStatus obtained from server is “negative”
  26. Ok – before concluding the solution section, quick emphasis on the implementation of the Façade.The Façade is a logical construct in terms of the architecture. It can be implemented by number of software components such as Application servers, databases, API management & exposure layer, analytics and so on. The good news is that the Façade Layer does not need to rebuild all the existing capabilities. The API Service Layer is a Façade on top of the existing capabilities. I wanted to make it clear that we show this layer as a single component – but that is just a logical representation.
  27. It must be a better available piece of infrastructure – Can be more secure – Can be protected by security. basic auth over SSL, IP filtering, etc.If the notification was received even after time-out – it can be debugged, On security,Some information received in the call back is not necessary for the client app. Façade can hide those from client.
  28. Logging, alerting, forwarding to another server.. Etc.SLA monitoring is another important thing to consider for asynch calls. That can be done by the Façade layer as well.
  29. This pattern can be employed to convert inherently asynchronous transport into synchronous.1. JMS interface can be converted into HTTP/REST.
  30. This is totally driven by user experience / requirement enforced by the use case?What is the SLA the backend is providing for the call back?Technically also it can not be infinitely long – all HTTP clients, routers, gateways and servers have reasonable timeouts defined. We should not hit on the borderline of such time lines. Most appliances have 60 to 120 seconds defined.
  31. Apply this pattern only client-application scenarios – where having a call back is not possible..Better user experience in terms of of request processing time.Also holding the request state in a API Façade Layer is a costly use case for a mediation layer. So for a very high throughput transaction this pattern is costly.
  32. Provider choice to conscious developers.Though