Distributed Persistent Queue for State Machine Replication
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In a cluster of computer systems, sharing a single queue is inefficient and error-prone due to copying and duplication, necessitating a distributed structure that provides a globally-ordered set of objects or events for replicated state machines.
Innovation Solution
A distributed persistent queue is implemented, utilizing a sequencer for ordering information and an ID generator for unique timestamps, ensuring all systems access the same ordered queue structure, with elements stored in a shared log accessible to all systems, allowing applications like Paxos consensus protocols to use replicated state machines.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If a single queue is shared among multiple computer systems in a cluster, then each system can access the queue, but copying and duplication of the queue becomes inefficient and error-prone
Solution Approach 1:
The patent divides the queue into distributed segments stored across multiple nodes in a cluster. Each node maintains a portion of the queue elements, eliminating the need to copy the entire queue to each system while ensuring all nodes can access the globally-ordered elements through the distributed structure.
Solution Approach 2:
The patent introduces a sequencer as an intermediary component that assigns unique sequence numbers to queue elements. This sequencer mediates between the distributed nodes and the queue elements, ensuring global ordering without requiring each node to maintain or copy the entire queue structure.
2Ease of operation
If multiple computer systems each have their own queue copies, then each system can operate independently, but the ordering of elements becomes inconsistent across systems
Solution Approach 1:
The patent implements a feedback mechanism where each distributed node periodically synchronizes with the sequencer to obtain the latest sequence numbers and ordering information. This feedback loop ensures that all nodes maintain consistent views of the queue element ordering while preserving system independence for local operations.
Solution Approach 2:
The patent applies preliminary action by pre-assigning unique sequence numbers to queue elements at the time of insertion through the sequencer. This preliminary ordering information is stored with each element, allowing nodes to independently determine global ordering without needing to synchronize continuously, thus maintaining both independence and consistency.
3Productivity
If a distributed queue structure is implemented, then queue copying is eliminated, but additional complexity is introduced for ordering and synchronization
Solution Approach 1:
The patent enables self-service by embedding sequence numbers directly with each queue element. Each distributed node can independently determine the global ordering of elements using these embedded sequence numbers without requiring complex synchronization protocols or centralized coordination for every operation, thus reducing operational complexity while maintaining distribution benefits.
Data Source
AI summary
Disclosed are a method and system for implementing a distributed persistent queue. To implement the queue, an API is defined that includes a command to enqueue an object onto the queue, to obtain the ordering of all objects in the queue and to remove any item from the queue. Enqueuing an object includes obtaining a unique ID for the object from a generator and then storing the object in a persistent shared log, which provides persistent storage for the queue. Obtaining an ordering of all objects in the persistent queue includes receiving for each object stored in the queue a pair of values, the first being the unique ID and the second being a sequence number from the persistent shared log. Regardless of the host computer system making the request for the ordering of objects in the queue the ordering provided to each host computer system is the same.


