JSON Schema Redesign for Query Cost Optimization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing methods for fetching data from nested JSON structures in NoSQL databases require complex code and result in increased response time and memory consumption, negatively impacting application performance.

Innovation Solution

A method that calculates the cost of data fetching based on query execution time and nested layers, and re-designs the JSON document schema using historical query patterns and execution times to optimize data retrieval, reducing complexity and improving performance.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Loss of time

If data is fetched by traversing nested JSON structures, then data can be retrieved from NoSQL databases, but query execution time increases and application performance deteriorates

Engineering Contradiction:
Improvequery execution timeVSAvoidapplication performance
Core Design Contradiction:
Loss of timeVSProductivity

Solution Approach 1:

The system performs preliminary analysis of query patterns and JSON schema structures to identify optimization opportunities before actual data fetching occurs. By pre-calculating traversal costs and identifying high-cost query patterns, the system can proactively optimize schema designs and query approaches, thereby reducing execution time and improving application performance.

Inventive Principle:
Principle #10Preliminary action

2Adaptability or versatility

If complex nested JSON schemas are used to represent complex data, then data representation capability improves, but traversal complexity and memory consumption increase

Engineering Contradiction:
Improvedata representation capabilityVSAvoidtraversal complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The system dynamically changes parameters related to JSON schema traversal by analyzing query patterns and identifying high-cost access paths. It transforms the traversal approach by selecting alternative fields or restructuring queries based on calculated costs, thereby reducing traversal complexity while maintaining the ability to represent complex data structures.

Inventive Principle:
Principle #35Parameter changes

3Reliability

If thorough traversal of nested JSON layers is performed to fetch required data, then data retrieval completeness improves, but memory consumption and processing overhead increase

Engineering Contradiction:
Improvedata retrieval completenessVSAvoidmemory consumption
Core Design Contradiction:
ReliabilityVSUse of energy by moving object

Solution Approach 1:

The system extracts and analyzes specific high-cost traversal paths from the JSON structure by calculating access costs for different fields. It identifies and removes unnecessary traversal steps by selecting optimal access paths based on query patterns and schema structure, thereby reducing memory consumption and processing overhead while ensuring complete retrieval of required data.

Inventive Principle:
Principle #2Taking out (Extraction)

Data Source

PatentUS11341135B2Optimizing JSON document usage
Publication Date: 2022.05.24 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US11341135B2 patent drawing
  • US11341135B2 patent drawing
  • US11341135B2 patent drawing

AI summary

An approach is provided for optimizing data fetching. A query employing a method to fetch data from a JSON document is received. An amount of time required to execute the query and a number of nested layers in a traversal of the JSON document required to fetch the data are determined. Based on the amount of time and the number of nested layers, a cost associated with an execution of the query is calculated. The cost is determined to exceed a threshold value. Responsive to the determination that the cost exceeds the threshold value and using historical query patterns and historical query execution times, a schema of the JSON document is re-designed. The data is fetched from the JSON document using the re-designed schema.