Publication Retention in Publish-Subscribe Brokers
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In publish/subscribe messaging systems, there is a latency issue with subscriber-initiated subscribe and unsubscribe operations, especially in low-bandwidth or unreliable connections, leading to delays in receiving publications, and existing solutions for retaining messages are either inflexible or inefficient in managing cumulative information.
Innovation Solution
A method where publishers indicate whether new publications should be retained with previous ones, allowing the broker to append new publication contents to the previous retained publication, simplifying storage and providing cumulative information to new subscribers.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Quantity of substance
If the broker retains only the latest publication for each topic, then storage space is minimized, but new subscribers receive incomplete cumulative information
Solution Approach 1:
The retained publication is segmented into two distinct parts: the original latest publication and the appended cumulative information. This segmentation allows the broker to store both the current state and historical context separately within a single retained message structure, resolving the contradiction between minimizing storage and preserving cumulative information.
Solution Approach 2:
The broker performs preliminary action by automatically appending cumulative information to retained publications before new subscribers receive them. This preliminary preparation ensures that subscribers immediately receive complete information without requiring multiple requests or waiting for additional publications, thus preserving information completeness while maintaining storage efficiency.
2Loss of information
If the broker retains multiple previous publications for each topic, then new subscribers receive complete cumulative information, but storage needs increase and broker operations become more complex
Solution Approach 1:
Multiple previous publications are merged into a single appended cumulative information field within the retained publication structure. This merging consolidates what would otherwise require storing multiple separate message objects into one unified structure, reducing storage needs and simplifying broker operations while maintaining complete cumulative information.
Solution Approach 2:
The retained publication structure is designed with multi-functionality: it serves both as the latest publication reference and as a cumulative information repository. This universal structure eliminates the need for separate storage mechanisms for historical data, reducing operational complexity while preserving complete information for new subscribers.
3Adaptability or versatility
If publishers can specify retention behavior for each publication, then flexibility in managing retained information is improved, but the complexity of the publishing interface increases
Solution Approach 1:
The complex retention management logic is extracted from the publisher interface and relocated to the broker side. Publishers simply indicate whether a publication should be retained using a simple flag, while the broker handles the complex operations of appending cumulative information and managing retained publications. This extraction maintains flexibility while minimizing interface complexity for publishers.
Solution Approach 2:
The broker acts as an intermediary that translates simple publisher retention flags into complex retention management operations. The broker mediates between the simplified publisher interface and the sophisticated information management requirements, allowing publishers to specify retention behavior flexibly without directly implementing complex retention logic.
Data Source
AI summary
For managing the retention of publications in a publish/subscribe system, a publisher sends a new publication to a publish/subscribe broker with an indication of whether the new publication should be retained in association with a previous retained publication. The publish/subscribe broker responds to such indications by retaining the new publication with the previous retained publication. The contents or ‘payload’ of the new published message may be appended to a previous retained message, resulting in a single retained message that contains information from multiple published messages.


