Dynamic Retry Logic for Microservice Response Time
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In microservices architecture, the circuit breakers of upstream and downstream services do not coordinate effectively, leading to wasted computing resources as the upstream service times out while the downstream service continues retrying, causing the upstream service to timeout before the downstream service can respond.
Innovation Solution
The downstream service adjusts its retry logic based on metadata received from the upstream service, including response time requirements, to perform retry attempts within the specified time, thereby avoiding the situation where the upstream service times out while the downstream service continues retrying.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If the downstream service continues retrying the request to the additional downstream service, then the reliability of the request is improved, but the response time exceeds the metadata-defined limit causing the upstream service to timeout
Solution Approach 1:
The circuit breaker dynamically adjusts its retry logic based on metadata received from the upstream service. The number of retry attempts and backoff intervals are modified in real-time to ensure the total retry duration does not exceed the metadata-defined response time limit, thereby adapting the reliability strategy to time constraints
Solution Approach 2:
The patent changes the parameters of the circuit breaker's retry logic by modifying the number of retry attempts and backoff intervals based on metadata from the upstream service. This parameter adjustment ensures that retry operations complete within the specified response time while maintaining adequate reliability
2Reliability
If the circuit breaker implements multiple retry attempts with incremental backoff, then the reliability of service calls is improved, but computing resources are wasted when the upstream service times out before the downstream service can respond
Solution Approach 1:
The downstream service receives metadata from the upstream service that defines the maximum response time. This feedback information is used to adjust the circuit breaker's retry logic, allowing the system to optimize reliability attempts based on actual time constraints and avoid wasting computing resources on futile retry attempts
Solution Approach 2:
The circuit breaker performs preliminary adjustment of its retry logic based on metadata received from the upstream service before initiating retry attempts. This preliminary action sets the appropriate number of retry attempts and backoff intervals in advance, preventing resource waste on excessive retries that would exceed the metadata-defined response time
Data Source
AI summary
A computer-implemented method includes: receiving, by a computer device, a request from an upstream service in a microservices architecture, wherein the computer device runs a downstream service in the microservices architecture and wherein the request includes metadata; modifying, by the computer device, retry logic of the downstream service; sending, by the computer device, a request to an additional downstream service; performing, by the computer device, retry attempts of the request to the additional downstream service in accordance with the modified retry logic; and sending, by the computer device, a response to the upstream service within a response time defined by the metadata.


