Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.
@dkershaw_msft
your
Your app
Gateway
Your or your
customer’s
data
Office 365 Windows 10 Enterprise Mobility + Security
1Microsoft Graph
Get to know the API
prepared
Graph uses server-
side page size limits
When querying
collections, Graph
may return the results
in many pages
Always expe...
1.
Always handle the
possibility that the
responses are paged
in nature
2.
Follow the
@odata.nextLink
to obtain the next
p...
Error Best practice
403 How did this happen? My application got consent!
The signed-in user does not have privileges to ac...
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
unnecessar...
Use filters
GET ?
$filter=department eq ‘Sales’ & $select=givenName,mail
Choose the records your
app really needs and no
m...
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...
Webhooks
Scenario
Application needs to know
about changes to data – like
deleted users
Tips
Use webhook notifications when...
Delta query
Scenario
Need to cache or store Microsoft
Graph data locally, and keep that
data up to date, or track changes
...
Webhooks Delta query
Scenario
Same scenarios as before,
but if you need to
optimize further…
Tips
Use webhook notification...
Batching
Scenario
Mobile client app needs to get
signed-in user’s profile AND
avatar
Tip
Use JSON batching
Why
Performance...
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 E...
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.
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.
Prochain SlideShare
Chargement dans…5
×

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

655 vues

Publié le

Learn how to take advantage of APIs, platform capabilities and intelligence from Microsoft Graph to make your app more performant, more resilient and more reliable

Publié dans : Technologie
  • Soyez le premier à commenter

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

  1. 1. @dkershaw_msft
  2. 2. your Your app Gateway Your or your customer’s data Office 365 Windows 10 Enterprise Mobility + Security 1Microsoft Graph
  3. 3. Get to know the API
  4. 4. prepared
  5. 5. 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
  6. 6. 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
  7. 7. 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
  8. 8. Retry logic for transient errors
  9. 9. Storing data locally in your application required terms of service privacy policy retention deletion policies
  10. 10. Optimizations
  11. 11. 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
  12. 12. 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
  13. 13. 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
  14. 14. 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
  15. 15. 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
  16. 16. 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
  17. 17. 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
  18. 18. best practices https://aka.ms/graphBestPractices
  19. 19. influence our roadmap User Voice
  20. 20. 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
  21. 21. https://graph.microsoft.com Twitter #MicrosoftGraph GitHub /MicrosoftGraph StackOverflow [MicrosoftGraph]

×