SlideShare a Scribd company logo
Best practices with Microsoft Graph: Making your applications more performant, resilient, and reliable.
@dkershaw_msft
Best practices with Microsoft Graph: Making your applications more performant, resilient, and reliable.
your
Your app
Gateway
Your or your
customer’s
data
Office 365 Windows 10 Enterprise Mobility + Security
1Microsoft Graph
Get to know the API
Best practices with Microsoft Graph: Making your applications more performant, resilient, and reliable.
prepared
Graph uses server-
side page size limits
When querying
collections, Graph
may return the results
in many pages
Always expect an
@odata.nextLink
property in the response
Contains the URL to the next page
1.
Always handle the
possibility that the
responses are paged
in nature
2.
Follow the
@odata.nextLink
to obtain the next
page of results
3.
Final page will not
contain an
@odata.nextLink
property
4.
Treat the entire URL
as an opaque string
Error Best practice
403 How did this happen? My application got consent!
The signed-in user does not have privileges to access the resource requested.
Tip: Provide a generic "Access denied" error back to the signed-in user.
404 How did this happen? I just got this resource!
Resource not yet provisioned (like a user's photo)
Resource has been deleted
Tip: Watch for restore - your application should also take this into account.
429 Your app should always be prepared to be throttled.
Tip: Honor the HTTP Retry-After response header to recover
Tip: Rate limit to stay below throttle limits
503 Service is busy
Tip: Retry – but employ a back-off strategy similar to 429
Tip: Additionally, always make new retry requests over a new HTTP connection
Retry logic for
transient errors
Storing data locally in
your application
required
terms of service
privacy policy
retention
deletion policies
Optimizations
Use projections
GET ?
$select=givenName,mail
Choose the properties
your app really needs
and no more
Don’t send
unnecessary data
over the wire
Tip
Use $select
Use filters
GET ?
$filter=department eq ‘Sales’ & $select=givenName,mail
Choose the records your
app really needs and no
more
Don’t send
unnecessary data
over the wire
Tip
Use $filter
POST/PATCH/PUT
If your code doesn’t need
to get a response, then
opt out
Don’t send
unnecessary data
over the wire
Tip
Use HTTP
Prefer return=minimal
request header
Webhooks
Scenario
Application needs to know
about changes to data – like
deleted users
Tips
Use webhook notifications whenever
data of interest has changed
Put notifications in a queue for later
processing
Why
Avoid computationally
expensive and excessive
polling
Delta query
Scenario
Need to cache or store Microsoft
Graph data locally, and keep that
data up to date, or track changes
to data for any other reasons
Tip
Use delta query
Why
Stop retrieving data your application already has!
Minimizes network traffic
Reduces the likelihood of reaching a throttling
threshold
Webhooks Delta query
Scenario
Same scenarios as before,
but if you need to
optimize further…
Tips
Use webhook notifications as the
trigger to make delta query calls
Put notifications in a queue for later
processing
Why
Difficult to figure out optimal
polling interval
THR2436 Barracuda Sentinel: Microsoft Graph powered AI for real-time cyber
fraud defense
Batching
Scenario
Mobile client app needs to get
signed-in user’s profile AND
avatar
Tip
Use JSON batching
Why
Performance gains through multiplexing
Save the application significant network latency
Conserves connection resources
Lower bandwidth consumption
best practices
https://aka.ms/graphBestPractices
influence our roadmap
User Voice
Related sessions
BRK2409 Leveraging SharePoint as a development platform for the
modern intranet
Tue 4:45
BRK2406 Coding Enterprise Apps for Intune – Protected, Secured &
Integrated
Wed 8:30
BRK2410 Data-Driven and User-Centric: Improving enterprise productivity
and engagement through graph powered notifications
Wed 4:30
THR3304 Cognitive Services + Microsoft Graph Tue 5:30
THR2430 Intelligent Edge: Microsoft Graph and IoT Wed 9:00
THR2413 Bots + Teams + Microsoft Graph: the perfect combo to help
manage your calendar
Wed 11:00
THR3302 Azure Functions and Microsoft Graph Wed 12:30
THR2436 Barracuda Sentinel: Microsoft Graph powered AI for real-time
cyber fraud defense
Wed 1:00
THR2437 Smart UI with Adaptive Cards, Microsoft Graph and beyond Wed 2:00
TSP2013 Microsoft Graph Device Remote Sessions Wed 3:30
WRK2510 Build intelligent intranet portals with SharePoint Wed 4:00
https://graph.microsoft.com
Twitter
#MicrosoftGraph
GitHub
/MicrosoftGraph
StackOverflow
[MicrosoftGraph]
Best practices with Microsoft Graph: Making your applications more performant, resilient, and reliable.
Best practices with Microsoft Graph: Making your applications more performant, resilient, and reliable.
Best practices with Microsoft Graph: Making your applications more performant, resilient, and reliable.

More Related Content

PDF
Principles of SAP HANA Sizing - on premise and cloud-1.pdf
PDF
Apache Kafka - Event Sourcing, Monitoring, Librdkafka, Scaling & Partitioning
PDF
Introduction To Kibana
PDF
Apache Kafka® Use Cases for Financial Services
PPTX
IBM Security QRadar
PPTX
SAP Business One
PPTX
SAP Basis Overview
PPTX
Apache Kafka Architectures and Fundamentals
Principles of SAP HANA Sizing - on premise and cloud-1.pdf
Apache Kafka - Event Sourcing, Monitoring, Librdkafka, Scaling & Partitioning
Introduction To Kibana
Apache Kafka® Use Cases for Financial Services
IBM Security QRadar
SAP Business One
SAP Basis Overview
Apache Kafka Architectures and Fundamentals

What's hot (20)

PDF
Securing Kafka
PDF
5. Identity and Access Management
PPTX
Apache kafka
PPTX
Protecting your data at rest with Apache Kafka by Confluent and Vormetric
PDF
What's new in Autonomous Database - OCYatra2023 - Sandesh Rao.pdf
PDF
Handling eventual consistency in a transactional world with Matteo Cimini and...
PPTX
Open Metadata and Governance with Apache Atlas
PDF
Pets vs. Cattle: The Elastic Cloud Story
PPTX
Data warehousing and data mart
PDF
SDN-ppt-new
PPTX
Cloud Security Architecture.pptx
PDF
Apache Spark Crash Course
PPTX
Modern Data Architecture
PDF
Accelerating digital transformation in SAP environment
ODP
Introduction To Data Warehousing
PDF
Simplified Machine Learning Architecture with an Event Streaming Platform (Ap...
PPTX
SAP Governance,Risk and Compliance
PDF
IBM InfoSphere Guardium overview
PDF
Data Streaming with Apache Kafka in the Defence and Cybersecurity Industry
PPTX
QRadar, ArcSight and Splunk
Securing Kafka
5. Identity and Access Management
Apache kafka
Protecting your data at rest with Apache Kafka by Confluent and Vormetric
What's new in Autonomous Database - OCYatra2023 - Sandesh Rao.pdf
Handling eventual consistency in a transactional world with Matteo Cimini and...
Open Metadata and Governance with Apache Atlas
Pets vs. Cattle: The Elastic Cloud Story
Data warehousing and data mart
SDN-ppt-new
Cloud Security Architecture.pptx
Apache Spark Crash Course
Modern Data Architecture
Accelerating digital transformation in SAP environment
Introduction To Data Warehousing
Simplified Machine Learning Architecture with an Event Streaming Platform (Ap...
SAP Governance,Risk and Compliance
IBM InfoSphere Guardium overview
Data Streaming with Apache Kafka in the Defence and Cybersecurity Industry
QRadar, ArcSight and Splunk
Ad

Similar to Best practices with Microsoft Graph: Making your applications more performant, resilient, and reliable. (20)

PPTX
Designing a Scalable Twitter - Patterns for Designing Scalable Real-Time Web ...
PPT
IEEE KUET SPAC presentation
PPT
Application Performance Lecture
PPT
Developing Profitable APIs - John Fraser - Platform A
DOCX
KMS (1)
PPT
3 Tier Architecture
PPT
Fanug - Pragmatic Windows Phone Developer
PPT
Leveraging The Cloud In 2009
PPT
Web engineering
PDF
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...
PDF
Thinking Beyond Core Web Vitals - Web performance optimisations for the harsh...
PPT
Oracle Coherence: in-memory datagrid
PDF
Porting an Open Source Lp Solver to Web Assembly
PDF
Secret Web Performance Metric - DevDayBe
PDF
[TDC 2013] Integre um grid de dados em memória na sua Arquitetura
PPT
W-JAX Performance Workshop - Database Performance
PPTX
Kafka error handling patterns and best practices | Hemant Desale and Aruna Ka...
PDF
Modern Web Applications
PPT
Lead Allocation System - Attribute Driven Design (ADD)
PDF
Secret Performance Metric - Armada JS.pdf
Designing a Scalable Twitter - Patterns for Designing Scalable Real-Time Web ...
IEEE KUET SPAC presentation
Application Performance Lecture
Developing Profitable APIs - John Fraser - Platform A
KMS (1)
3 Tier Architecture
Fanug - Pragmatic Windows Phone Developer
Leveraging The Cloud In 2009
Web engineering
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...
Thinking Beyond Core Web Vitals - Web performance optimisations for the harsh...
Oracle Coherence: in-memory datagrid
Porting an Open Source Lp Solver to Web Assembly
Secret Web Performance Metric - DevDayBe
[TDC 2013] Integre um grid de dados em memória na sua Arquitetura
W-JAX Performance Workshop - Database Performance
Kafka error handling patterns and best practices | Hemant Desale and Aruna Ka...
Modern Web Applications
Lead Allocation System - Attribute Driven Design (ADD)
Secret Performance Metric - Armada JS.pdf
Ad

More from Microsoft Tech Community (20)

PPTX
100 ways to use Yammer
PPTX
10 Yammer Group Suggestions
PPTX
Removing Security Roadblocks to IoT Deployment Success
PPTX
Building mobile apps with Visual Studio and Xamarin
PPTX
Interactive emails in Outlook with Adaptive Cards
PPTX
Unlocking security insights with Microsoft Graph API
PPTX
Break through the serverless barriers with Durable Functions
PPTX
Multiplayer Server Scaling with Azure Container Instances
PPTX
Explore Azure Cosmos DB
PPTX
Media Streaming Apps with Azure and Xamarin
PPTX
DevOps for Data Science
PPTX
Real-World Solutions with PowerApps: Tips & tricks to manage your app complexity
PPTX
Azure Functions and Microsoft Graph
PPTX
Ingestion in data pipelines with Managed Kafka Clusters in Azure HDInsight
PPTX
Getting Started with Visual Studio Tools for AI
PPTX
Using AML Python SDK
PPTX
Mobile Workforce Location Tracking with Bing Maps
PPTX
Cognitive Services Labs in action Anomaly detection
PPTX
Speech Devices SDK
PPTX
LinkedIn Learning presents: Securing web applications in ASP.NET Core 2.1
100 ways to use Yammer
10 Yammer Group Suggestions
Removing Security Roadblocks to IoT Deployment Success
Building mobile apps with Visual Studio and Xamarin
Interactive emails in Outlook with Adaptive Cards
Unlocking security insights with Microsoft Graph API
Break through the serverless barriers with Durable Functions
Multiplayer Server Scaling with Azure Container Instances
Explore Azure Cosmos DB
Media Streaming Apps with Azure and Xamarin
DevOps for Data Science
Real-World Solutions with PowerApps: Tips & tricks to manage your app complexity
Azure Functions and Microsoft Graph
Ingestion in data pipelines with Managed Kafka Clusters in Azure HDInsight
Getting Started with Visual Studio Tools for AI
Using AML Python SDK
Mobile Workforce Location Tracking with Bing Maps
Cognitive Services Labs in action Anomaly detection
Speech Devices SDK
LinkedIn Learning presents: Securing web applications in ASP.NET Core 2.1

Recently uploaded (20)

PDF
Encapsulation theory and applications.pdf
PPTX
Spectroscopy.pptx food analysis technology
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PPTX
Tartificialntelligence_presentation.pptx
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Approach and Philosophy of On baking technology
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPT
Teaching material agriculture food technology
Encapsulation theory and applications.pdf
Spectroscopy.pptx food analysis technology
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Network Security Unit 5.pdf for BCA BBA.
Unlocking AI with Model Context Protocol (MCP)
A comparative analysis of optical character recognition models for extracting...
Building Integrated photovoltaic BIPV_UPV.pdf
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Tartificialntelligence_presentation.pptx
A comparative study of natural language inference in Swahili using monolingua...
NewMind AI Weekly Chronicles - August'25-Week II
Encapsulation_ Review paper, used for researhc scholars
Approach and Philosophy of On baking technology
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Mobile App Security Testing_ A Comprehensive Guide.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Teaching material agriculture food technology

Best practices with Microsoft Graph: Making your applications more performant, resilient, and reliable.

  • 4. your Your app Gateway Your or your customer’s data Office 365 Windows 10 Enterprise Mobility + Security 1Microsoft Graph
  • 5. Get to know the API
  • 8. Graph uses server- side page size limits When querying collections, Graph may return the results in many pages Always expect an @odata.nextLink property in the response Contains the URL to the next page
  • 9. 1. Always handle the possibility that the responses are paged in nature 2. Follow the @odata.nextLink to obtain the next page of results 3. Final page will not contain an @odata.nextLink property 4. Treat the entire URL as an opaque string
  • 10. Error Best practice 403 How did this happen? My application got consent! The signed-in user does not have privileges to access the resource requested. Tip: Provide a generic "Access denied" error back to the signed-in user. 404 How did this happen? I just got this resource! Resource not yet provisioned (like a user's photo) Resource has been deleted Tip: Watch for restore - your application should also take this into account. 429 Your app should always be prepared to be throttled. Tip: Honor the HTTP Retry-After response header to recover Tip: Rate limit to stay below throttle limits 503 Service is busy Tip: Retry – but employ a back-off strategy similar to 429 Tip: Additionally, always make new retry requests over a new HTTP connection
  • 12. Storing data locally in your application required terms of service privacy policy retention deletion policies
  • 14. Use projections GET ? $select=givenName,mail Choose the properties your app really needs and no more Don’t send unnecessary data over the wire Tip Use $select
  • 15. Use filters GET ? $filter=department eq ‘Sales’ & $select=givenName,mail Choose the records your app really needs and no more Don’t send unnecessary data over the wire Tip Use $filter
  • 16. POST/PATCH/PUT If your code doesn’t need to get a response, then opt out Don’t send unnecessary data over the wire Tip Use HTTP Prefer return=minimal request header
  • 17. Webhooks Scenario Application needs to know about changes to data – like deleted users Tips Use webhook notifications whenever data of interest has changed Put notifications in a queue for later processing Why Avoid computationally expensive and excessive polling
  • 18. Delta query Scenario Need to cache or store Microsoft Graph data locally, and keep that data up to date, or track changes to data for any other reasons Tip Use delta query Why Stop retrieving data your application already has! Minimizes network traffic Reduces the likelihood of reaching a throttling threshold
  • 19. Webhooks Delta query Scenario Same scenarios as before, but if you need to optimize further… Tips Use webhook notifications as the trigger to make delta query calls Put notifications in a queue for later processing Why Difficult to figure out optimal polling interval THR2436 Barracuda Sentinel: Microsoft Graph powered AI for real-time cyber fraud defense
  • 20. Batching Scenario Mobile client app needs to get signed-in user’s profile AND avatar Tip Use JSON batching Why Performance gains through multiplexing Save the application significant network latency Conserves connection resources Lower bandwidth consumption
  • 23. Related sessions BRK2409 Leveraging SharePoint as a development platform for the modern intranet Tue 4:45 BRK2406 Coding Enterprise Apps for Intune – Protected, Secured & Integrated Wed 8:30 BRK2410 Data-Driven and User-Centric: Improving enterprise productivity and engagement through graph powered notifications Wed 4:30 THR3304 Cognitive Services + Microsoft Graph Tue 5:30 THR2430 Intelligent Edge: Microsoft Graph and IoT Wed 9:00 THR2413 Bots + Teams + Microsoft Graph: the perfect combo to help manage your calendar Wed 11:00 THR3302 Azure Functions and Microsoft Graph Wed 12:30 THR2436 Barracuda Sentinel: Microsoft Graph powered AI for real-time cyber fraud defense Wed 1:00 THR2437 Smart UI with Adaptive Cards, Microsoft Graph and beyond Wed 2:00 TSP2013 Microsoft Graph Device Remote Sessions Wed 3:30 WRK2510 Build intelligent intranet portals with SharePoint Wed 4:00

Editor's Notes