Sidecar Proxy Message Tracking for Microservice Loss Recovery
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing microservices architectures lack effective methods to detect and remediate lost or failed messages beyond the receipt acknowledgment, leading to potential business losses and untraceable application errors.
Innovation Solution
Implementing an intelligent message loss detection (IMLD) system that intercepts messages, uses timers and retry policies, and manages message attempts in an in-memory database to ensure successful delivery and processing.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If HTTP status codes are used to determine message delivery status, then the receiving end can identify whether the message was received or failed, but the sender cannot determine whether the message was successfully processed after receiving a 200 OK status
Solution Approach 1:
The patent implements a feedback mechanism where the receiving microservice sends an acknowledgment message back to the sender microservice to confirm successful processing. This feedback loop allows the sender to verify not just that the message was received (HTTP 200 OK), but that it was actually processed successfully, thereby resolving the information loss about processing status.
Solution Approach 2:
The patent uses a sidecar proxy to preemptively intercept and save message information to a database before the message is processed. This preliminary action ensures that even if the message processing fails or information is lost, the original message data is preserved and can be retried later, preventing permanent information loss.
2Reliability
If messages are retried indefinitely to ensure delivery, then message delivery reliability improves, but system resources are wasted and productivity decreases
Solution Approach 1:
The patent implements a retry mechanism with a maximum attempt limit. Instead of retrying indefinitely, the system performs a partial number of retry attempts (up to a configured maximum). This approach provides sufficient reliability for most cases while preventing excessive resource consumption and maintaining system productivity, thus resolving the contradiction between reliability and efficiency.
3Difficulty of detecting and measuring
If a sidecar proxy intercepts and tracks every message to detect losses, then message loss detection capability improves, but device complexity increases
Solution Approach 1:
The patent introduces a sidecar proxy as an intermediary component between the sender microservice and the receiving microservice. This intermediary intercepts messages, tracks their status, and manages retries without requiring complex modifications to the existing microservices. The sidecar handles all the complexity of message tracking and loss detection, keeping the core services simple while achieving high detection capability.
4Speed
If message information is stored in an in-memory database for retry management, then retry operation speed improves, but data persistence and reliability under system failure decrease
Solution Approach 1:
The patent changes the state persistence parameter by storing message information in an in-memory database during active retry operations for high-speed access. However, when the maximum retry attempt is reached or the message is successfully delivered, the system persists the final state to durable storage. This parameter change approach allows the system to optimize for speed during retries while ensuring reliability and data persistence for final states, resolving the contradiction between speed and reliability.
Data Source
AI summary
An example methodology may be executed by a sidecar proxy attached to a microservice. The method includes intercepting an outgoing request message from the microservice, saving the request message to a first database, and initiating a timer specifying a predetermined time for retrying the request message. The method also includes, responsive to a determination that the timer expired, incrementing a current attempt count for the request message, wherein the current attempt count being a count of retries of the request message, and responsive to a determination that the current attempt exceeds a maximum retry attempts permitted for the request message, saving the request message to a second database. The method also includes, responsive to a determination that the current attempt count does not exceed the maximum retry attempts permitted, retrieving the request message from the first database, retrying the request message, and initiating the timer for the request message.


