NUMA Buffer Segmentation for Database Lock Contention
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In database systems, frequent interactions with disks for reading and writing data lead to increased I/O overheads and reduced performance due to lock contention among service threads competing for buffer resources.
Innovation Solution
Implementing a data read and write method in a NUMA system where each node has a buffer and controller, allowing data to be written or read from a target buffer on a different node, reducing lock contention by distributing buffer resources across nodes.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Device complexity
If a single buffer is used for data read/write operations in a database system, then data access can be simplified, but lock contention increases and database performance deteriorates
Solution Approach 1:
The patent divides the single buffer into multiple buffers distributed across different nodes in the NUMA system. Each buffer is independently managed by its own controller, allowing parallel access without lock contention. This segmentation resolves the contradiction by maintaining simplicity at the individual buffer level while achieving high performance through distributed architecture.
Solution Approach 2:
The patent transitions from a single-dimension buffer architecture to a multi-dimensional distributed buffer architecture across NUMA nodes. By adding the spatial dimension of distribution across multiple nodes, the system achieves both simplified individual buffer management and improved overall performance through parallel operations.
2Productivity
If multiple service threads access the buffer simultaneously, then throughput increases, but lock contention increases and performance decreases
Solution Approach 1:
By segmenting the buffer into multiple independent buffers across different nodes, the patent allows multiple service threads to access different buffers simultaneously without lock contention. Each thread can operate on its assigned buffer independently, achieving high throughput without time loss due to locking.
Solution Approach 2:
Each buffer node operates autonomously with its own controller, enabling self-service operations without requiring centralized lock management. Threads access buffers directly without waiting for lock acquisition, eliminating lock wait time while maintaining high throughput.
3Reliability
If data is frequently read from/written to disk, then data persistence is ensured, but I/O overhead increases and performance reduces
Solution Approach 1:
The patent implements preliminary action by maintaining buffers in memory that cache data before disk write operations. Data is first written to the distributed buffers, and only when buffers are full or flushing is needed does the system perform disk I/O. This preliminary caching reduces the frequency of disk operations while ensuring data persistence.
Solution Approach 2:
By segmenting the buffer across multiple nodes, the patent enables parallel I/O operations when flushing data to disk. Multiple buffers can be written to disk simultaneously, reducing total I/O time and improving performance while maintaining data persistence through reliable write operations.
Data Source
AI summary
A data write method, a data read method, a device, and a system are provided. The data write method is applied to a computer device, which includes a storage device and a plurality of nodes in a non-uniform memory access architecture (NUMA) system, and each node has a buffer and a controller that controls the buffer. The data write method includes: obtaining a write request of target data; determining, in response to the write request, a target page that is in the storage device and that stores the target data; determining, from a plurality of buffers corresponding to the plurality of nodes, a target buffer corresponding to the target page; writing the target data into a page of the target buffer by using a target controller that controls the target buffer; and writing data of the page of the target buffer into the target page in the storage device.


