Self-Tuning Object-Relational Mapping via Usage Statistics
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Object/relational application program interfaces (O/R APIs) face performance issues due to reading excessive data from relational databases, as they lack efficient mechanisms to determine which parts of the object graph to query, leading to labor-intensive and error-prone manual annotations.
Innovation Solution
A system and method that utilizes a mapping module to identify the code location requesting database data, a retrieval module to amend parameters based on usage statistics, and a load module to fetch a subset of data, optimizing data retrieval by determining how the data will be used by the application program.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If the O/R API reads all parts of the object graph from the database, then complete data is available for the application program, but performance deteriorates due to reading excessive data
Solution Approach 1:
The system performs partial action by reading only the necessary subset of data from the database based on usage statistics, rather than reading all possible data. The load module fetches only the specific parts of the object graph that are predicted to be used by the application program, eliminating unnecessary data retrieval while maintaining data completeness for actual needs.
Solution Approach 2:
The system performs preliminary action by pre-analyzing usage statistics to determine which data will be needed before actually querying the database. The retrieval module uses historical usage patterns to predict and pre-determine the optimal data subset to load, avoiding the need to read all data and then filter it.
2Productivity
If developers manually annotate the O/R API to read specific parts of the object graph, then performance improves by reducing data retrieval, but the process becomes labor-intensive and error prone
Solution Approach 1:
The system performs self-service by automatically generating optimization configurations based on usage statistics without requiring manual developer intervention. The retrieval module autonomously analyzes usage patterns and determines the optimal data subset to load, eliminating the need for developers to manually annotate the O/R API while achieving the same performance benefits.
Solution Approach 2:
The system uses feedback from actual usage statistics to automatically adjust and optimize data retrieval behavior. By monitoring how the application program actually uses the data, the system continuously refines its predictions and optimizes the subset of data loaded, replacing manual annotation with automated, data-driven optimization.
3Adaptability or versatility
If the O/R API reads data without knowing how it will be used, then the interface remains simple and flexible, but performance problems occur due to reading more data than needed
Solution Approach 1:
The system introduces an intermediary layer (the retrieval module) between the O/R API and the database that uses usage statistics to intelligently determine what data to load. This intermediary automatically optimizes data retrieval based on predicted usage patterns, allowing the O/R API to maintain its simple and flexible interface while the intermediary handles the performance optimization transparently.
Data Source
AI summary
A system and method for database access by an application program includes a database interface that receives a request to access database data that includes a set of parameters. A mapping module determines the place in the application program code that requested the database data. A retrieval module reads a set of usage statistics and amends the set of parameters based on the usage statistics. A load module fetches the database data and data for related objects that are likely to be accessed from the requested data, based on the amended parameters. Once the database data has been loaded, a tracking module tracks the database data and updates the set of usage statistics accordingly.


