Message Scheduling Method for Database Concurrency Control

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current database management systems face issues with concurrency and performance due to the use of file locks, leading to increased CPU overhead and a higher likelihood of deadlocks, especially in client-server models and embedded databases like SQLite.

Innovation Solution

A message scheduling method that employs a control thread to receive and process messages by adding flags to determine if they require exclusive or shared mode processing, allocating them accordingly to worker threads, and managing message queues to maintain data consistency and reduce lock contention.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If file locks are used to ensure data consistency in database management systems, then data integrity is maintained, but concurrency is degraded and CPU overhead increases

Engineering Contradiction:
Improvedata integrityVSAvoidconcurrency
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent segments the monolithic file lock mechanism into fine-grained row-level locks. Instead of locking the entire database file, the system locks only specific rows that are being accessed or modified. This segmentation allows other clients to access different rows simultaneously, thereby maintaining data integrity for locked rows while significantly improving overall database concurrency.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent applies local quality by implementing different locking granularities for different data access patterns. Row-level locks are applied to specific rows being modified, while read-only operations can access data without acquiring locks. This localized application of locking ensures data consistency only where necessary, reducing the overall impact on concurrency and CPU overhead.

Inventive Principle:
Principle #3Local quality

2Reliability

If file locks are used to manage database access, then data consistency is maintained, but CPU overhead increases due to lock contention

Engineering Contradiction:
Improvedata consistencyVSAvoidCPU overhead
Core Design Contradiction:
ReliabilityVSUse of energy by moving object

Solution Approach 1:

By segmenting locks into row-level granularity, the patent reduces lock contention and the associated CPU overhead. Instead of multiple clients contending for a single file lock, each client contends only for locks on specific rows they need to access. This segmentation dramatically reduces the frequency and intensity of lock contention, thereby reducing CPU overhead while maintaining data consistency.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent employs copy-on-write mechanisms where data pages are copied before modification. This allows read operations to proceed without acquiring locks on the original data, reducing lock contention and CPU overhead. The copying mechanism ensures that writers have exclusive access to their copy while readers continue to access the original unmodified data.

Inventive Principle:
Principle #26Copying

3Reliability

If locks are used to manage critical sections in client-server database models, then resource protection is ensured, but performance degrades due to lock overhead

Engineering Contradiction:
Improveresource protectionVSAvoidperformance
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent segments the database into pages and rows, allowing fine-grained locking at the row level rather than locking entire pages or files. This segmentation enables multiple clients to access different rows simultaneously, protecting critical resources while maintaining high performance through parallel access to non-conflicting data.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent implements dynamic locking where the granularity and duration of locks adapt based on the specific operation and data access patterns. Locks are acquired only for the minimum necessary time and scope to protect critical sections, and released as soon as the operation completes. This dynamic approach minimizes performance degradation while ensuring resource protection.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS10372517B2Message scheduling method
Publication Date: 2019.08.06 TMAXTIBERO CO LTD
  • US10372517B2 patent drawing
  • US10372517B2 patent drawing
  • US10372517B2 patent drawing

AI summary

Disclosed are a message scheduling method performed by one or more processors of a computing device and a device thereof. The message scheduling method performed by one or more processors of the computing device may include: receiving, by a control thread, a message from a client; adding, by the control thread, a flag to the received message based on contents of the message; storing, by the control thread, the message with the flag added in a queue; and allocating, by the control thread, the message stored in the queue to each worker thread based on the flag.