Transactional Streaming Writes for Exactly-Once Data Processing
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In distributed storage systems, ensuring that data is processed exactly once is challenging due to the need for careful coordination between producing and consuming systems, which can result in lost records or duplicated computations.
Innovation Solution
The method involves using transactional streaming writes, where data blocks are partitioned into sub-batches and written to buffered streams, with updates to a storage log indicating intent to commit, ensuring that each data block is written exactly once.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If careful coordination between producing and consuming systems is implemented to ensure exactly-once processing, then data reliability is improved, but system complexity increases
Solution Approach 1:
The patent introduces a buffered stream as an intermediary component between the producing system (data writer) and consuming system (data reader). The buffered stream acts as a mediator that receives data blocks, manages their state through buffering, and coordinates commits atomically. This intermediary absorbs the coordination complexity internally through its buffer management and commit protocols, while presenting a simple interface to both producers and consumers, thereby ensuring exactly-once processing without requiring complex external coordination mechanisms.
Solution Approach 2:
The patent segments the data processing workflow into distinct phases: writing data blocks to the buffered stream, marking them as committed, and reading from committed data. The buffered stream itself is segmented into buffer regions that can be independently managed. This segmentation allows each component to focus on a specific task with clear boundaries, reducing the overall system complexity while maintaining the exactly-once guarantee through phase-separated operations.
2Reliability
If data blocks are partitioned into sub-batches and written to buffered streams, then exactly-once processing is achieved, but processing time increases
Solution Approach 1:
The patent performs preliminary actions by pre-allocating buffer regions in the buffered stream before data blocks are written. The buffer structure is prepared in advance with committed and uncommitted regions clearly defined. This preliminary setup eliminates the need for complex buffer management and allocation decisions during the actual data writing process, reducing processing time while maintaining the exactly-once guarantee through pre-established buffer boundaries and commit protocols.
Solution Approach 2:
The buffered stream maintains continuous useful action by allowing overlapping operations: data blocks can be written to the buffer while other blocks are being read from committed regions. The buffer management operates continuously without idle periods, and the commit process is streamlined to minimize interruptions. This continuous operation reduces overall processing time while the buffered stream's atomic commit mechanism ensures exactly-once processing is maintained throughout.
Data Source
AI summary
A method for processing data exactly once using transactional stream writes includes receiving, from a client, a batch of data blocks for storage on memory hardware in communication with the data processing hardware. The batch of data blocks is associated with a corresponding sequence number and represents a number of rows of a table stored on the memory hardware. The method also includes partitioning the batch of data blocks into a plurality of sub-batches of data blocks. For each sub-batch of data blocks, the method further includes assigning the sub-batch of data blocks to a buffered stream; writing, using the assigned buffered stream, the sub-batch of data blocks to the memory hardware; updating a storage log with an intent to commit the sub-batch of data blocks using the assigned buffered stream; and committing the sub-batch of data blocks to the memory hardware.


