Dual Publisher-Subscriber Module for State Synchronization
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing systems for content synchronization between multiple clients and a server face challenges in balancing reliability and latency, particularly in scenarios where clients can both view and edit content, such as forum postings or digital rooms, as they often require storing messages to a persistence layer, which increases latency.
Innovation Solution
Implementing a dual publisher-subscriber module system, comprising a lossless module that stores messages to a persistence layer for critical updates and a best-effort module that does not, allowing for efficient message routing based on message types to ensure reliability without excessive latency.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If messages are stored to a persistence layer to ensure reliability, then reliability is improved, but latency increases
Solution Approach 1:
The publisher-subscriber module is segmented into two distinct components: a lossless publisher-subscriber module that stores messages to a persistence layer for critical updates, and a best-effort publisher-subscriber module that does not store messages for non-critical updates. This segmentation allows the system to achieve both reliability and low latency by directing different types of messages to appropriate modules based on their importance.
2Reliability
If a single publisher-subscriber module stores all messages to maintain consistency, then reliability is improved, but system performance deteriorates due to increased latency
Solution Approach 1:
Different publisher-subscriber modules are assigned different qualities based on message requirements. The lossless module provides reliable storage for critical messages that require persistence, while the best-effort module provides fast, non-blocking delivery for non-critical messages. This local differentiation of quality allows the system to optimize both reliability and performance simultaneously.
Data Source
AI summary
A computer-implemented method for state synchronization may include (i) identifying a type of a message from a client device to a server that includes an intended update to content hosted on the server, (ii) determining, based on the type of the message, whether to direct the message to a best-effort publisher-subscriber module or a lossless publisher-subscriber, (iii) directing the message to the best-effort publisher-subscriber module based on the type of the message, (iv) identifying a different type of an additional message from the client device to the server that includes a new intended update to the content, and (v) directing the additional message to the lossless publisher-subscriber module based on the different type of the additional message. Various other methods, systems, and computer-readable media are also disclosed.


