API Query can Simplify Architecture and Improve Efficiency

The era of smart devices and apps has transformed the way application integrations work. These integrations need to be performed with limited memory and in constrained bandwidth environments. For a long time, REST was the choice for such integrations because of its simplicity. ?There is no doubt that REST has simplified integrations. But consumers of the APIs have no way to control the size and shape of the API response. Moreover, REST is based on the principle of resources; if a consumer needs data from two different resources, two separate requests go to the server.

No alt text provided for this image

Figure 1: REST API client requesting data from multiple sources

This is the problem API-querying technologies like GraphQL and OData are trying to address. API-querying technologies enable API users to query only the information required from multiple data sources with a single request. These technologies?expand the idea of SQL to web APIs by exposing the complete business object to users – providing them the ability to query an object by declaring the fields and conditions in the API request. Only the information that a user requested is returned in the single API response. This means no over-fetch, no under-fetch – only the precise information requested is retrieved.

No alt text provided for this image

Figure 2: Client requesting data from multiple sources using GraphQL/OData?

These technologies help applications that run on devices and the front-end to offer the best user experience in low CPU and low bandwidths, rather than spending computing resources for processing heavy response data. However, API querying is not just restricted to a front-end layer; it can be applied to any layer of the enterprise.

Wipro helped one of the largest financial institutions in the US to modernize its legacy application stack using GraphQL. The financial leader was running an application on the mainframe and wanted to gradually migrate to reduce the recurring cost of MIPS on the mainframe. The customer selected Cassandra as the target data platform and exposed data APIs on this platform.

Wipro leveraged these data APIs to build GraphQL-enabled Springboot microservices for customer profile, express consent, and more. The benefits to the financial leader not only included lean and clean API use, but also a simplified architecture by aggregating multiple data APIs and presenting the data as a single business object for use by internal and external applications.

?When to Use API Querying or REST

?API querying is a good option when –

  • Consumer needs to have control of the response data
  • When there are bandwidth concerns
  • Aggregation of data required from multiple sources
  • Need to control network costs by regulating the data flow

That doesn’t mean REST is going away. Certain high-performance queries need to be addressed by REST to avoid an additional layer of API query. In addition, REST also provides a robust framework based on HTTP, which is easily comprehensible to both machines and humans. However, API query is an intuitive way to fetch exactly the information requested.

This article is also published on wiprodigital

Md.Intisam Alam

Principal Enterprise Architect -Integration -BT

3 年

Insightful..it really helps

要查看或添加评论,请登录

Habin Poothattayil的更多文章

  • An Integration Fabric on AWS

    An Integration Fabric on AWS

    Cloud has become the preferred choice of application deployment for all size of enterprises. Since application…

    4 条评论
  • Reimagining the Integration Platform

    Reimagining the Integration Platform

    Integration platform is the channel which caters to the needs of data within and outside of the organizational…

    8 条评论
  • Microservices: Is that your cup of tea?

    Microservices: Is that your cup of tea?

    Since its inception around 2010, MSA (Micro Service Architecture) is the talk of the town, no matter what it is…

  • Microgateways: ‘Lightweight’ is the new normal for digital success

    Microgateways: ‘Lightweight’ is the new normal for digital success

    With enterprises adopting the API-first approach as part of their digital journey, APIs have taken center stage of…

    4 条评论

社区洞察

其他会员也浏览了