Client Buffer for PubSub Message Rate Regulation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing publish-subscribe (PubSub) systems face performance instability during message surges and are prone to message loss or client device overload, as they often do not cache messages and process all events on the client device, leading to degradation in performance.
Innovation Solution
A method and system that divert messages to a buffer on the client device when the messaging application cannot keep up with the message rate, allowing the buffer to temporarily store and forward messages at a rate suitable for the application, ensuring proper ordering and preventing message loss or client device overload.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Speed
If messages are processed directly by the messaging application without buffering, then message delivery speed is improved, but the system becomes unstable during message surges and may lose messages or overload the client device
Solution Approach 1:
A buffer component is introduced as an intermediary between the message stream and the messaging application. The buffer receives messages at high speed from the PubSub system and regulates their flow to the messaging application, preventing overload while maintaining message delivery. This mediator absorbs the shock of message surges and smooths the flow to match the application's processing capacity.
Solution Approach 2:
The buffer performs preliminary actions by pre-processing and regulating messages before they reach the messaging application. It controls the rate at which messages are delivered to the application, ensuring that the application is always ready to handle incoming messages without being overwhelmed by sudden surges.
2Loss of time
If all events and messages are processed on the client device, then message freshness is improved, but performance degradation occurs when message flow exceeds client processing capacity
Solution Approach 1:
The buffer acts as an intermediary that handles the heavy lifting of message reception and regulation, allowing the messaging application to focus on processing messages at its own pace. This separation of concerns prevents the client device from becoming overwhelmed while still maintaining message freshness through rapid buffer operation.
Solution Approach 2:
The buffer performs excessive action by maintaining a ready queue of pre-processed messages, ensuring that the messaging application always has messages available to process immediately. This partial processing in advance (maintaining the buffer) ensures message freshness without requiring the full processing capacity to be constantly engaged.
3Productivity
If messages are sent directly to the messaging application at the desired feed rate, then message delivery rate is improved, but message loss occurs when the application cannot keep up with the message rate
Solution Approach 1:
The buffer provides beforehand cushioning by maintaining a safety margin of stored messages. When the messaging application falls behind in processing, the buffer has already accumulated messages that can be delivered at a reduced rate without causing message loss. This cushion protects against message loss during periods when the application cannot keep up with the desired feed rate.
Solution Approach 2:
The buffer mediates between the high-rate message stream and the variable-capacity messaging application. It absorbs the mismatch between production rate and consumption rate, ensuring that messages are not lost even when the application processes them slower than they arrive.
Data Source
Figure 1A~1B
Figure 2
Figure 3A
AI summary
Methods, systems, and apparatus, including computer programs encoded on a computer storage medium, are described for providing messages to client devices. In certain examples, a stream of messages is provided to a messaging application on a client device at a desired message feed rate. A message download rate of the stream of messages by the messaging application is monitored. A determination is made that the message download rate is less than the desired message feed rate. In response, the stream of messages is provided to a buffer on the client device at the desired message feed rate, and the stream of messages is sent from the buffer to the messaging application at the message download rate. A determination is made that the message download rate is greater than the desired message feed rate and, in response, a stored quantity of messages on the buffer is allowed to decrease. A determination is made that the stored quantity of messages on the buffer is zero and, in response, the stream of messages is provided to the messaging application at the desired message feed rate.