API Gateway Asynchronizer for Microservice Job Queues
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In microservice-based architectures, synchronous REST API calls can lead to blocking behavior and data conflicts due to time-consuming operations, resulting in poor user experience and increased complexity for developers in implementing asynchronous handling logic within microservices.
Innovation Solution
Implementing asynchronous API handling at the API gateway layer with an asynchronizer component that manages job queues, handles job scheduling, status updates, retries, and provides visibility into job progress, allowing microservices to remain simple and synchronous.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If synchronous REST API calls are used in microservices, then the microservice code remains simple, but the caller is blocked and user experience deteriorates due to long waiting times
Solution Approach 1:
The patent extracts the asynchronous handling logic from the microservice code and places it in a separate job queue management system. The microservice only needs to submit jobs and retrieve results, while the queue management system handles the asynchronous execution and state tracking, thereby resolving the contradiction between simple microservice code and good user experience.
Solution Approach 2:
The patent introduces a job queue management system as an intermediary between the caller and the microservice. This intermediary handles the asynchronous job submission, execution tracking, and result retrieval, allowing the caller to continue operations without blocking while maintaining simple microservice code.
2Loss of time
If asynchronous handling logic is implemented within microservices, then blocking behavior is avoided and user experience improves, but the microservice code complexity increases
Solution Approach 1:
The patent extracts the complex asynchronous handling logic from the microservice code and places it in a separate job queue management system. The microservice code remains simple with only job submission and result retrieval operations, while the extraction of complex logic to an external system resolves the contradiction between improved user experience and reduced code complexity.
Solution Approach 2:
The patent segments the system into distinct components: the simple microservice that submits jobs, the job queue management system that handles asynchronous execution, and the result retrieval mechanism. This segmentation allows each component to have a specific, simple function while the overall system achieves asynchronous behavior without blocking.
3Reliability
If synchronous API calls are used, then the API gateway remains simple, but data conflicts occur due to impatient user retries on blocking operations
Solution Approach 1:
The patent introduces a job queue management system as an intermediary that provides unique job identifiers and tracks job execution state. This intermediary prevents data conflicts by ensuring that each operation is uniquely identified and tracked, eliminating the need for complex retry logic in the API gateway while maintaining data consistency.
Solution Approach 2:
The patent implements a feedback mechanism where the job queue management system provides status updates and result notifications to callers. This feedback loop allows callers to check job status without retrying operations, preventing data conflicts while keeping the API gateway simple.
Data Source
AI summary
A method of handling an API call includes receiving a first API call from a job requestor, the first API call including a job to be executed by a microservice. The method also includes adding the job to a job queue, making a second, synchronous, API call including the job to the microservice, updating the job queue upon successful completion of the job by the microservice, and notifying the job requestor of the successful completion of the job.


