Adaptive API Gateway for Synchronous Asynchronous Execution
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing computerized systems require developers to create and maintain separate synchronous and asynchronous APIs, limiting flexibility and increasing maintenance complexity, as they need to handle requests of varying execution times and payload sizes.
Innovation Solution
A smart service that determines whether to execute API requests synchronously or asynchronously based on predicted execution time, using machine learning to assess factors like requestor identity, API, payload size, and prior execution times, allowing for a generic service API that adapts execution mode at runtime.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If separate synchronous and asynchronous APIs are created and maintained, then system reliability is improved by handling different execution time requirements, but device complexity increases due to maintaining multiple API versions
Solution Approach 1:
The patent implements a single unified API that can dynamically operate in both synchronous and asynchronous modes based on the predicted execution time of incoming requests. The API gateway analyzes request characteristics and automatically selects the appropriate execution mode, eliminating the need for separate synchronous and asynchronous API versions while maintaining system reliability for different execution time requirements.
2Adaptability or versatility
If separate synchronous and asynchronous APIs are maintained, then adaptability is improved by handling varying execution times, but ease of manufacture deteriorates due to increased maintenance burden
Solution Approach 1:
A single adaptive API gateway is created that can handle both synchronous and asynchronous request processing through dynamic mode selection. This unified approach maintains adaptability to different execution time requirements while significantly reducing the maintenance burden compared to managing separate API versions, as updates and bug fixes need to be applied to only one codebase.
Solution Approach 2:
The API gateway incorporates dynamic behavior by adjusting its execution mode (synchronous or asynchronous) based on real-time analysis of request characteristics and predicted execution time. This dynamic adaptation allows the system to maintain versatility while simplifying the underlying infrastructure, as the same API endpoint can flexibly change its processing mode without requiring separate static API versions.
3Device complexity
If a single generic service API is used with dynamic mode selection, then device complexity is reduced by eliminating separate APIs, but measurement precision deteriorates in determining execution time requirements
Solution Approach 1:
The system performs preliminary analysis of incoming requests by examining request characteristics and using machine learning models to predict execution time before the actual processing occurs. This advance prediction allows the API gateway to make informed decisions about synchronous versus asynchronous mode selection, maintaining measurement precision through pre-computed estimates while using a single unified API gateway.
Solution Approach 2:
The API gateway acts as an intermediary layer between clients and the backend service, introducing a decision-making component that analyzes requests and selects appropriate execution modes. This intermediary layer maintains measurement precision through sophisticated prediction mechanisms while the underlying service remains a single unified implementation, effectively decoupling the complexity of mode selection from the core service logic.
4Ease of operation
If synchronous execution is used for all requests, then ease of operation is improved by immediate response, but loss of time increases for requests with long execution times
Solution Approach 1:
The system dynamically adjusts its execution mode based on the predicted duration of each request. For requests predicted to complete quickly, synchronous execution is used providing immediate responses and simple operation. For requests predicted to take longer, the system automatically switches to asynchronous execution, returning request IDs that clients can use to retrieve results later, thereby reducing the time clients wait while maintaining ease of operation through a unified interface.
Data Source
AI summary
Systems and techniques are provided that implement application programming interfaces (APIs) that can be executed synchronously or asynchronously depending on the expected response time of the API, the status of the API and/or systems that implement the API, the identity and/or type of user making a request via the API, historical requirements or operation of the API, and/or other factors.


