Optimistic Database Access Method for Data Consistency

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In multi-tiered Web-based applications, transaction isolation levels in database access often lead to data inconsistencies such as dirty reads, non-repeatable reads, and phantom reads, which can be mitigated but at the cost of reduced database performance due to locking mechanisms.

Innovation Solution

A three-step optimistic database access method is implemented, starting with an optimistic read, followed by pessimistic reads with increasing isolation levels if inconsistencies are detected, ensuring data consistency without excessive locking.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If transaction isolation levels are increased to prevent data inconsistencies, then data consistency is improved, but database performance deteriorates due to locking mechanisms

Engineering Contradiction:
Improvedata consistencyVSAvoiddatabase performance
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent implements dynamic adjustment of transaction isolation levels based on the specific operation type and data access patterns. The system transitions from a static isolation level to a dynamic one that adapts to different access scenarios, allowing higher isolation levels when needed and lower levels when concurrency is prioritized, thus resolving the contradiction between data consistency and performance

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent changes the isolation level parameter dynamically based on the operation context. Different isolation levels (e.g., read committed, repeatable read, serializable) are selected and adjusted according to the specific read/write operations being performed, enabling the system to optimize between consistency and performance by varying this critical parameter

Inventive Principle:
Principle #35Parameter changes

2Reliability

If locks are placed on database rows to ensure consistency, then data consistency is improved, but the number of concurrent data accesses is reduced

Engineering Contradiction:
Improvedata consistencyVSAvoidconcurrent data accesses
Core Design Contradiction:
ReliabilityVSAdaptability or versatility

Solution Approach 1:

The system dynamically determines whether to apply locking based on the specific access pattern and operation type. Instead of universally applying locks to all operations, the system adapts its locking behavior to minimize blocking while ensuring consistency where necessary, thereby maintaining higher concurrent access capability

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent segments the database access control into different strategies based on operation type and data access patterns. Different segments of operations use different isolation mechanisms (locking vs. versioning vs. snapshot isolation), allowing the system to maintain consistency without uniformly restricting all concurrent accesses

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS7774319B2System and method for an optimistic database access
Publication Date: 2010.08.10 SAP SE
  • US7774319B2 patent drawing
  • US7774319B2 patent drawing
  • US7774319B2 patent drawing

AI summary

In an embodiment, a database interface performs a three-step optimistic database access. The database interface initially performs an optimistic read of a database object. The database object is checked for consistency after the optimistic read. If the database object is inconsistent, a first pessimistic read is performed with an isolation level that does not guarantee consistency (e.g., with an isolation level of committed read). The database object is checked again for consistency after the first pessimistic read. If the database object is inconsistent, a second pessimistic read is performed with an isolation level that may guarantee consistency (e.g., with an isolation level of repeatable read).