Double-Write Logging for N:1 Stream Order Constraints
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing technologies fail to efficiently satisfy write order constraints between threads or streams without wasting storage space, particularly when multiple write requests need to be recorded in a specific order.
Innovation Solution
A method and apparatus for double writing based on write-ahead, which classifies write requests into write-ahead and write-behind, assigning two pairs of stream and epoch IDs to each request to ensure order constraints are met without wasting space.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If the order-guaranteed command flag is set to ensure write order between streams, then write order is guaranteed, but storage space is wasted
Solution Approach 1:
The patent segments the write request into two distinct parts: a header containing order-guarantee information and a data payload. This segmentation allows the order guarantee mechanism to operate independently from the actual data storage, enabling efficient use of storage space while maintaining write order guarantees through the header's epoch and stream ID fields.
Solution Approach 2:
The patent applies preliminary action by pre-establishing epoch counters and stream IDs in the write request header before the actual write operation. This preliminary setup allows the storage system to enforce order constraints without requiring additional space during the write operation itself, as the ordering information is already prepared in the header.
2Reliability
If multiple stream and epoch ID pairs are assigned to satisfy n:1 write order constraints, then order constraints are satisfied, but write command space becomes insufficient
Solution Approach 1:
The patent makes the write request header universal by designing it to handle multiple streaming scenarios through a single standardized structure. The header contains fields that can represent different stream and epoch combinations, allowing a single write command to satisfy n:1 order constraints across multiple streams without requiring separate commands for each stream, thus avoiding space exhaustion.
Solution Approach 2:
The patent resolves the space constraint by introducing a dimensional change in how order information is stored. Instead of storing multiple separate stream and epoch ID pairs in the write command, the system uses a unified header structure with fields that can be interpreted in different dimensional ways to represent multiple stream relationships, effectively adding a layer of abstraction that reduces storage requirements.
Data Source
AI summary
The present disclosure relates to a method and apparatus for double-writing based on write-ahead, which may be configured to: classify write requests for different streams into write-ahead and write-behind on the basis of sequence constraints; transform write-ahead into double-writing for the streams; and log the streams in compliance with the sequence constraints on the basis of the double-writing.


