Database Synchronization Batching and Sorting for Deadlock Prevention
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Database deadlocks occur during synchronization due to multiple data elements being associated with a common element, leading to inefficient and time-consuming updates.
Innovation Solution
Data elements are divided into batches and sorted before performing parallel database transactions, with each transaction sequentially locking and updating rows to prevent deadlocks.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If parallel database transactions are performed to update multiple data elements, then processing speed is improved, but deadlocks occur due to concurrent access to common data elements
Solution Approach 1:
The patent applies preliminary action by sorting data elements in a consistent order before executing parallel transactions. This pre-establishes a deterministic access sequence that prevents circular wait conditions causing deadlocks, while still allowing parallel processing to proceed efficiently
2Reliability
If data elements are updated sequentially to prevent deadlocks, then reliability is improved, but processing time increases
Solution Approach 1:
The patent segments data elements into batches that are sorted and processed in parallel transactions. Each batch is independently sortable and processable, allowing concurrent execution without interference. This segmentation maintains reliability through consistent ordering while preserving parallel processing performance
Solution Approach 2:
The patent performs preliminary sorting of data elements within each batch before parallel transaction execution. This pre-ordering ensures that all transactions access data in the same sequence, preventing deadlocks while allowing the actual data updates to proceed in parallel, thus reducing overall processing time compared to purely sequential updates
Data Source
AI summary
Embodiments of the present disclosure include techniques for storing and updating data in a database. In one embodiment, data elements are stored in a many to one relationship in different tables. When data updates occur, the records to be updated are divided into batches and sorted. Database transactions to update the batches are performed in parallel. When one transaction accesses a record in the database, the record is locked. Other batches accessing the locked record may wait until the record is unlocked to complete their updates. The present techniques may improve database processing by reducing or eliminating database deadlocks, for example.


