Concurrency Reduction via Publish-Subscribe Message Queue
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In microservices architecture, multiple instances of the same service concurrently requesting data from a back-end service lead to redundant requests, causing unnecessary stress and delays, as existing technologies fail to effectively prevent redundant traffic.
Innovation Solution
Implementing a concurrency reduction message service using publish-subscribe patterns, where services subscribe to a shared message queue, map requests to keys, cache responses, and block redundant requests until a response is received, thereby reducing concurrency and preventing redundant requests to the back-end service.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If multiple service instances concurrently request data from a back-end service, then system productivity is improved through parallel processing, but redundant requests cause increased stress and delays on the back-end service
Solution Approach 1:
The system performs preliminary actions by checking for existing requests before allowing new concurrent requests to proceed. Each service instance checks the request queue and cache before submitting a new request, preventing redundant requests from being sent to the back-end service while maintaining the ability to process multiple requests in parallel when necessary
2Productivity
If service instances redundantly request the same data multiple times, then system productivity is maintained through continuous processing, but memory consumption and processing time increase
Solution Approach 1:
The system checks the request queue and cache before allowing new requests to proceed. This preliminary check prevents redundant requests from being processed, eliminating unnecessary processing time and memory consumption while maintaining system productivity through efficient request handling
Solution Approach 2:
The system implements feedback mechanisms where service instances are notified when requests are completed or when data is available in the cache. This feedback loop allows service instances to stop waiting and proceed with alternative operations, reducing overall processing time for redundant requests
3Reliability
If a proxy or cache service is introduced to reduce concurrency, then back-end service stress is reduced, but device complexity and implementation difficulty increase
Solution Approach 1:
The system enables service instances to self-manage concurrency by implementing the check-then-proceed logic within each service instance itself. Each service instance independently checks the request queue and cache before submitting requests, eliminating the need for a centralized proxy or cache management service and reducing overall system complexity
Data Source
AI summary
Receiving a plurality of concurrent incoming requests from the plurality of services, with each incoming request and each service subscribing to a topic in a shared message queue. The queue is used for: notifying other subscribers when a request to a back-end service is being made; and/or notifying other subscribers when a response from the back-end service is received.


