DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • What Is GraphQL?
  • Projections/DTOs in Spring Data R2DBC
  • JQueue: A Library to Implement the Outbox Pattern
  • 2-Tier Architecture vs 3-Tier Architecture in DBMS

Trending

  • Designing Memory Architecture for Stateful AI Agents: Short-Term Context and Long-Term Persistence
  • Evaluating RAG in Production — What the Numbers Actually Revealed
  • Three Measured Outcomes of Manually Scaling Fleet in Prod
  • Every Acquisition Promises One Company. Most Deliver Two.

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  1. DZone
  2. Data Engineering
  3. Databases
  4. Unleash the power of Anypoint DataGraph

Unleash the power of Anypoint DataGraph

With Anypoint DataGraph, you can reuse multiple APIs in a single request. Enterprise architects can easily unify APIs into one data service all without writing more code. Developers can consume multiple APIs from the data service in a single GraphQL request.

By 
Jitendra Bafna
·
Updated Aug. 21, 21 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
25.4K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

In this blog, we will be learn about how to unify multiple APIs into single data service with Anypoint DataGraph. Before we start with Anypoint DataGraph, we need to understand the GraphQL and Anypoint DataGraph is the layer built on the top of GraphQL.

GraphQL is an open-source query language for Rest API's and it is developed by Facebook in 2012 before releasing publicly in 2015. GraphQL allows you to send the query to your API and get the required data. 

REST APIs are powerful and follow a resource-oriented and well-structured approach. However, when the data is complex and it is not possible to fetch all the data within a single request as it involved various operations and routes get more complex. GraphQL is very useful in such cases and structures data in the form of a graph with its powerful query syntax for traversing, retrieving, and modifying data. 

GraphQL is capable of aggregating the data, returns predictable data to the clients.

Anypoint DataGraph

Anypoint DataGraph is component of Anypoint Platform which allows you to unify the multiple APIs into single data service.

With Anypoint DataGraph, you can reuse multiple APIs in a single request. Enterprise architects can easily unify APIs into one data service — all without writing more code. Developers can consume multiple APIs from the data service in a single GraphQL request.

Advantages of Anypoint DataGraph

  • Unify the multiple APIs into the single data service. With Anypoint DataGraph, you can serve data from multiple underlying APIs within single request without writing any code.
  • Consume the data from multiple APIs using single request.
  • Developer doesn't have to write the code to parse the data from multiple APIs.
  • Anypoint DataGraph is managed service, no maintenance or patching for IT. 

Restrictions

Anypoint DataGraph supports:

  • REST APIs with RAML and OAS specifications
  • Only GET methods
  • 250 APIs per unified schema
  • 16,000 fields per unified schema

Anypoint DataGraph restricts downstream REST API calls to:

  • A maximum of 150 concurrent or ongoing calls per unified schema
  • A 5 second timeout per call
  • A maximum of 5 MB of response data per call

Anypoint DataGraph limits the query service to:

  • A 30 second timeout per query
  • A maximum of 100 selected fields per query. 

Authentication Mechanism

DataGraph support below list of Authentication mechanism while calling underlying APIs

  • Basic Authentication
  • Client Id Enforcement via Headers
  • Client Id Enforcement via Query Params
  • Custom (Add Custom headers or Query Params)

Use Case 1

Let's consider the scenario, you have Rest API that returns 10 fields in response but web application requires only 7 fields whereas mobile application requires only 4 fields. In such cases, DataGraph is one of the most optimal options where the client can pass whatever data required as an input request, and DataGraph will return the required fields to the Web Application and Mobile Application. Below is the illustration of Use Case 1.

Use Case 2

Let's consider the scenario where you have to call multiple Rest APIs or want to fetch data from multiple rest API's and each APIs will respond with JSON payload. GraphQL will aggregate all the responses and send back the required data to the client. Below is the illustration of Use Case 2.

Unleash the power of Anypoint DataGraph - Part I


Unleash the power of Anypoint DataGraph - Part II


Unleash the power of Anypoint DataGraph - Part III

Now, you know how to use Anypoint DataGraph and what are different use cases where Anypoint DataGraph can be used.

Data (computing) Database Use case mobile app GraphQL

Opinions expressed by DZone contributors are their own.

Related

  • What Is GraphQL?
  • Projections/DTOs in Spring Data R2DBC
  • JQueue: A Library to Implement the Outbox Pattern
  • 2-Tier Architecture vs 3-Tier Architecture in DBMS

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook