1. Jul 21, 2022
Toronto MuleSoft Meetup - #18
Anypoint DataGraph
Unify Data From Multiple APIs
into one Data Service
2. 2
#MuleSoftMeetups
Mahesh Pujari
MuleSoft Developer
at Mackenzie
Investments.
Overall, 10 Years of
experience in IT.
Around 7 years of
integration expertise.
3+ Years using Mulesoft
3x Mulesoft Certified
Kishore Reddy Paluri
Solutions Architect
at MuleSoft.
15 years of experience
building Integration, ESB,
SOA, API, Security and
Middleware solutions on
Cloud, On-Prem, and
Hybrid environments.
Organizers
Anurag Dwivedi
Associate Solution Architect
at Apisero
9 years of experience creating
solutions for
Manufacturing,Healthcare,Ban
king and Airline Clients
Certified Platform Architect
Certified Integration Architect
Sravan Lingam
I am an All certified Senior
Mulesoft Developer and
Architect. MuleSoft
Ambassador. I have 7 years of
overall IT experience with 5+
years in Mulesoft. I started my
journey with Mulesoft in 2015
and worked for Insurance,
Retail, Banking domains. My
skill set includes Java, Spring
MVC, Hibernate, Bootstrap,
Material Design.
5. What is 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.
● Who uses Graphql: https://landscape.graphql.org/card-mode
5
6. What is Anypoint DataGraph?
Anypoint DataGraph is a component of Anypoint Platform which allows you to unify the multiple
APIs into a single data service. Anypoint DataGraph is the unified platform for APIs to design,
develop and manage. It allows to discover, manage or serve the data from multiple apis using
single DataGraph request.
This reduces a lot of efforts for developers to call multiple APIs and aggregate the response. With
Anypoint DataGraph, you can request only data you want, no more or no less.
6
7. Anypoint DataGraph Advantages
⮚ Unify the multiple APIs into the single data service. With Anypoint DataGraph, you can
serve data from multiple underlying APIs within a single request without writing any code.
⮚ Consume the data from multiple APIs using a 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.
⮚ Request the data you want, no more no less.
⮚ Reduce development and maintenance efforts.
⮚ Anypoint DataGraph is a managed service and no need to worry about underlying
infrastructure and maintenance.
7
8. Use Case 1
Let's consider the scenario, you have a 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.
8
9. Use Case 2
Let's consider the scenario where you have to call multiple rest endpoints or want to fetch data
from multiple rest endpoints 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.
9
10. Use Case 3
Let's consider the scenario where you have to call multiple Rest APIs to fetch account details
and related customer details. Customer details and Account details exist in different APIs.
CustomerId is the primary key in customers apis and accountId is the primary key in accounts
apis. Also, customerId is foreign key in accounts apis. Below is the illustration of Use Case 3.
10
12. Anypoint DataGraph Contd…
Monitor or Trace or Measure the API Performance
⮚ With a single UI, it is possible to trace the query response time and logs, ensuring to
measure the performance of query or apis request and meets expected SLA’s.
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)
⮚ No Auth
⮚ Pass-through Authentication
⮚ Oauth 2.0 Client Credentials
12
13. Anypoint DataGraph Restrictions
● Anypoint DataGraph supports:
✔ REST APIs with RAML and OAS specifications
✔ 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.
13