API Service Coalescing Subqueries for Write Operations
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing application programming interfaces (APIs) face inefficiencies in processing read and write operations, particularly in handling one-to-many relationships, which result in a large number of queries and increased resource usage due to sequential execution of queries across multiple data sources.
Innovation Solution
The method involves determining a navigable path of nodes in a graph projection of the API to generate subqueries, identifying associated data repositories, and coalescing subqueries to execute them in parallel or asynchronously, reducing the number of queries and improving resource utilization by optimizing read and write operations.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If multiple individual write queries are generated to commit data for one-to-many relationships, then data integrity is maintained, but the number of queries increases and resource usage increases
Solution Approach 1:
The patent combines multiple individual write queries into a single batched write operation. The system identifies one-to-many relationships in the data model and consolidates writes to child records into a single query that accepts multiple records, thereby maintaining data integrity while reducing the total number of queries executed and improving resource utilization
Solution Approach 2:
The system performs preliminary analysis of the data write operation to identify one-to-many relationships before execution. By pre-processing the write request to group related records and determine the optimal batching strategy, the system prepares the consolidated query structure in advance, enabling efficient execution while ensuring data consistency across parent and child records
2Device complexity
If sequential query execution is used across multiple data sources, then resource usage is managed systematically, but processing time increases
Solution Approach 1:
The patent implements dynamic query execution by analyzing the data model and relationship structure at runtime. The system determines whether to execute queries sequentially or in parallel based on the specific one-to-many relationship pattern and data source configuration, allowing flexible adaptation to different scenarios while optimizing processing time without sacrificing systematic resource management
Solution Approach 2:
The system segments the overall write operation into independent units that can be executed in parallel. By dividing the consolidated write query into separate batch operations for different child records or data sources, the system enables concurrent execution where possible, reducing total processing time while maintaining manageable complexity through structured segmentation
Data Source
AI summary
The present disclosure relates to processing write requests across a plurality of data sources. According to one embodiment, an example method includes determining a navigable path of nodes accessed to satisfy a write request in a graph projection of an application programming interface (API). An API service generates a plurality of subqueries, each subqueries being associated with a node in the navigable path. While traversing the navigable path to execute the write request, the API service identifies one or more nodes in the navigable path sharing an association with a data repository associated with the current node and upon which execution of a write operation associated with the current node depends. The API service coalesces a set of subqueries associated with the current node and the identified one or more nodes into a single subquery and executes the single subquery.


