Globally Unique Index Conflict Detection in Distributed Databases
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Distributed databases face challenges in ensuring the uniqueness of indices across multiple nodes, leading to potential data conflicts and reduced availability, as existing methods rely on service levels that increase complexity and may not guarantee data correctness.
Innovation Solution
A method and apparatus that utilize a conflict detection SQL statement to determine if a globally unique index is valid across all database nodes, processing the original SQL request only if the conflict detection result is within an expected value, and rolling back data if conflicts are detected.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If service level approaches are used to guarantee uniqueness of unique index in distributed database, then data correctness may be maintained, but system complexity increases and availability is reduced
Solution Approach 1:
The patent performs conflict detection before executing the original SQL statement by issuing a conflict detection SQL statement to check for potential unique index conflicts. This preliminary action identifies conflicts in advance, allowing the system to avoid executing statements that would cause data correctness issues, thereby maintaining reliability without requiring complex service-level conflict resolution mechanisms.
Solution Approach 2:
The patent extracts the conflict detection function from the original SQL execution process by creating a separate conflict detection SQL statement. This separation allows the system to check for conflicts independently before executing the main operation, reducing the complexity of service-level conflict management while maintaining data correctness through automated detection.
2Reliability
If service level approaches are used to guarantee uniqueness of unique index in distributed database, then data correctness may be maintained, but system availability is reduced
Solution Approach 1:
By performing conflict detection before SQL execution, the system can quickly identify and reject conflicting operations without entering complex service-level conflict resolution processes. This preliminary check improves system availability by enabling faster decision-making on whether to proceed with SQL execution, reducing the time operations are blocked while maintaining data correctness.
Solution Approach 2:
The system performs self-service conflict detection by automatically issuing conflict detection SQL statements and evaluating results without requiring external service-level intervention. This automation maintains data correctness through consistent conflict detection while improving availability by eliminating the need for complex service-level conflict resolution processes.
3Reliability
If conflict detection SQL statement is issued to each database node, then globally unique index correctness is ensured, but processing time increases
Solution Approach 1:
The patent segments the conflict detection process by issuing separate conflict detection SQL statements to each database node independently. This segmentation allows parallel execution of conflict checks across distributed nodes, ensuring globally unique index correctness through comprehensive node-by-node verification while minimizing overall processing time through concurrent operation.
Solution Approach 2:
The patent replaces complex mechanical conflict resolution mechanisms with automated SQL-based conflict detection. By substituting service-level conflict management with structured SQL queries that automatically detect conflicts, the system ensures unique index correctness across distributed nodes while reducing processing overhead compared to traditional conflict resolution approaches.
Data Source
AI summary
Disclosed in embodiments of the present disclosure are methods and apparatuses for realizing a globally unique index, which are applicable to a distributed database. One of the methods includes: receiving a structured query language, SQL, request, obtaining a conflict detection SQL statement corresponding to the SQL request and calculating an expected value; issuing the conflict detection SQL statement to each database node for execution; obtaining an execution result of the conflict detection SQL statement, and comparing the execution result of the conflict detection SQL statement with the expected value; and when the execution result of the conflict detection SQL statement is less than or equal to the expected value, processing an original SQL statement of the SQL request, and issuing the original SQL statement to the each database node for execution.


