Declarative Schema API Composition for Microservice Maintenance
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing API systems face challenges in efficiently managing differences in conventions between services, leading to inefficiencies like overfetching and underfetching, and maintaining consistency across multiple microservices with rapid release cycles, which complicates the user interface and introduces errors due to multiple layers of mappings and business logic.
Innovation Solution
The generation of APIs using declarative schemas for each service, allowing for independent maintenance and loose coupling, where a service controller and language object are created to handle data events and expose APIs independently of other services, using a request gateway to orchestrate requests and manage version drift.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If a single coherent API graph is defined to solve REST limitations, then data fetching efficiency is improved, but system complexity and maintenance burden increase
Solution Approach 1:
The patent introduces an API composition service as an intermediary layer between clients and microservices. This service composes APIs dynamically by retrieving schemas from multiple microservices and combining them into a unified GraphQL schema, eliminating the need for clients to directly manage complex multi-service API graphs while maintaining efficient data fetching capabilities
Solution Approach 2:
The patent segments the API management functionality into independent microservices, each maintaining its own declarative schema. The composition service aggregates these segmented schemas dynamically, allowing each microservice to evolve independently while presenting a unified API graph to clients, thus reducing overall system complexity
2Reliability
If multiple layers of mappings are maintained across services, then data entity definitions are preserved, but errors and inconsistencies increase
Solution Approach 1:
The patent uses declarative schemas as formal copies of data entity definitions that are maintained centrally with each microservice. These schemas are retrieved and composed by the API composition service, ensuring that all services work with consistent data entity definitions without requiring multiple layers of mapping transformations, thereby eliminating errors and inconsistencies
3Adaptability or versatility
If services are rapidly released with frequent updates, then adaptability and responsiveness are improved, but maintaining consistency across the API graph becomes difficult
Solution Approach 1:
The patent implements a dynamic API composition mechanism where the composition service retrieves schemas from microservices on-demand and combines them into a unified API graph. This dynamic composition allows the API graph to automatically adapt to rapid service updates and new releases, maintaining consistency without requiring manual synchronization or fixed deployment cycles
4Ease of manufacture
If independent service maintenance is enabled, then ease of maintenance and loose coupling are improved, but coordination and consistency management become harder
Solution Approach 1:
The patent implements a universal declarative schema format that can be used by any microservice regardless of its specific functionality. The API composition service uses this universal schema format to compose APIs across diverse services, enabling independent maintenance of each service while automatically coordinating them through a common schema-based interface, thus eliminating coordination complexity
Data Source
AI summary
Certain aspects of the present disclosure provide techniques for generating an application programming interface (API) for a plurality of associated services. The method generally includes retrieving a declarative schema for a service of a plurality of services in an application programming interface (API). A language object for the service is generated from a data object definition in the declarative schema associated with the service. Generally, the language object is configured to handle data events generated by the service. A service controller for the service is generated from a service definition in the declarative schema associated with the respective service. Generally, the service controller is fronted by a gateway for external sources to invoke one or more functions implemented by the service. An application programming interface (API) is exposed for the service independently of details of APIs for the associated services to one or more external services.


