Skip to content

Commit 1491a23

Browse files
authored
Merge pull request #26096 from microsoftgraph/freshness-deltaQuery-overview
[Content-Freshness] Delta query overview
2 parents a6fe890 + 8505b99 commit 1491a23

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

concepts/delta-query-overview.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ ms.topic: concept-article
88
ms.subservice: change-notifications
99
ms.localizationpriority: high
1010
ms.custom: graphiamtop20
11-
ms.date: 01/12/2024
11+
ms.date: 01/15/2025
1212
#customer intent: As a developer, I want to learn how to track changes to specific Microsoft Graph resources, so that I can build apps that process the changes according to the business requirements.
1313
---
1414

1515
# Use delta query to track changes in Microsoft Graph data
1616

1717
Delta query, also called *change tracking*, enables applications to discover newly created, updated, or deleted entities without performing a full read of the target resource with every request. Microsoft Graph applications can use delta query to efficiently synchronize changes with a local data store.
1818

19-
Using delta query helps you avoid constantly polling Microsoft Graph, as the app requests only data that changed since the last request. This pattern allows the application to reduce the amount of data it requests, thereby reducing the cost of the request and as such, likely limit the chances of the requests being [throttled](throttling.md).
19+
Using delta query helps you avoid constantly polling Microsoft Graph, as the app requests only data that changed since the last request. This pattern allows the application to reduce the amount of data it requests, thereby reducing the cost of the request and as such, likely limit the chances of the requests being [throttled](throttling.md).
20+
21+
Delta query uses a *pull* model, where the application requests changes from Microsoft Graph; while [change notifications](./change-notifications-overview.md) use a *push* model, where Microsoft Graph notifies the application of changes.
2022

2123
## Use delta query to track changes in a resource collection
2224

@@ -29,21 +31,21 @@ The typical call pattern is as follows:
2931
3032
2. Microsoft Graph responds with the requested resource and a [state token](#state-tokens).
3133

32-
a. If Microsoft Graph returns a `@odata.nextLink` URL, there are more pages of data to retrieve in the session, even if the current response contains an empty result. The application uses the `@odata.nextLink` URL to continue making requests to retrieve all pages of data until Microsoft Graph returns a `@odata.deltaLink` URL in the response.
34+
a. If Microsoft Graph returns a `@odata.nextLink` URL, there are more pages of data to retrieve in the session, even if the current response contains an empty result. The application uses the `@odata.nextLink` URL to continue making requests to retrieve all pages of data until Microsoft Graph returns a `@odata.deltaLink` URL in the response.
3335

34-
b. If Microsoft Graph returns a `@odata.deltaLink` URL, there's no more data about the existing state of the resource to return in the current session. For future requests, the application uses the `@odata.deltaLink` URL to learn about changes to the resource.
36+
b. If Microsoft Graph returns a `@odata.deltaLink` URL, there's no more data about the existing state of the resource to return in the current session. For future requests, the application uses the `@odata.deltaLink` URL to learn about changes to the resource.
3537

3638
c. A page can't contain both `@odata.deltaLink` and `@odata.nextLink`.
3739

3840
> [!NOTE]
39-
> The Microsoft Graph response in Step 2 includes the resources that *currently* exist in the collection. Resources that were deleted prior to the initial delta query aren't returned. Updates made before the initial request are summarized on the resource returned as its latest state.
41+
> The Microsoft Graph response in Step 2 includes the resources that *currently* exist in the collection. Resources that were deleted before the initial delta query aren't returned. Updates made before the initial request are summarized on the resource returned as its latest state.
4042
4143
4. When the application needs to learn about changes to the resource, it uses the `@odata.deltaLink` URL it received in step 2 to make requests. The application can make this request immediately after completing step 2 or when it checks for changes.
4244

4345
5. Microsoft Graph returns a response describing changes to the resource since the previous request, and either a `@odata.nextLink` URL or a `@odata.deltaLink` URL.
4446

4547
> [!NOTE]
46-
> - Resources stored in Microsoft Entra ID (such as users and groups) support "sync from now" scenarios. This allows you to skip steps 1 and 2 (if you're not interested in retrieving the full state of the resource) and ask for the latest `@odata.deltaLink` instead. Append `$deltatoken=latest` to the `delta` function and the response will contain a `@odata.deltaLink` and no resource data. Resources in OneDrive and SharePoint also support this feature but require `token=latest` instead.
48+
> - Microsoft Entra ID resources such as users and groups support "sync from now" scenarios. This feature allows you to skip steps 1 and 2 (if you're not interested in retrieving the full state of the resource) and ask for the latest `@odata.deltaLink` instead. Append `$deltatoken=latest` to the `delta` function and the response contains a `@odata.deltaLink` and no resource data. Resources in OneDrive and SharePoint also support this feature but require `token=latest` instead.
4749
> - `$select` and `$deltaLink` query parameters are supported for some Microsoft Entra resources so that customers can change the properties they want to track for an existing `@odata.deltaLink`. Delta queries with both `$select` and `$skiptoken` aren't supported.
4850
4951
### State tokens
@@ -165,7 +167,7 @@ Delta queries for supported resources are available for customers hosted on the
165167

166168
### Changes to properties stored outside the main data store aren't tracked
167169

168-
Some resources contain properties that are stored outside the main data store for the resource. For example, the [user](/graph/api/resources/user) resource data is mostly stored in Microsoft Entra ID, but some of its properties, like **skills**, are stored in SharePoint Online. Currently, only the properties stored in the main data store trigger changes in the delta query; properties stored outside the main data store aren't supported as part of change tracking. Therefore, a change to any of these properties doesn't result in an object showing up in the delta query response.
170+
Some resources contain properties that are stored outside the main data store for the resource. For example, some properties of the [user](/graph/api/resources/user) resource like **skills**, are stored in SharePoint and not Microsoft Entra ID. Currently, only the properties stored in the main data store trigger changes in the delta query; properties stored outside the main data store aren't supported as part of change tracking. Therefore, a change to any of these properties doesn't result in an object showing up in the delta query response.
169171

170172
For more information about properties stored outside of the main data store, see the [users](/graph/api/resources/users) and [groups](/graph/api/resources/groups-overview) documentation.
171173

@@ -201,9 +203,4 @@ Applications can use this strategy to nearly eliminate (only for supported resou
201203

202204
## Related content
203205

204-
Learn more about delta query in the following tutorials:
205-
206-
- [Get incremental changes to events in a calendar view](delta-query-events.md)
207-
- [Get incremental changes to messages in a folder](./delta-query-messages.md)
208-
- [Get incremental changes to groups](./delta-query-groups.md)
209-
- [Get incremental changes to users](./delta-query-users.md)
206+
- [Explore change notifications, which uses a push model to notify your app when a resource changes](./change-notifications-overview.md)

0 commit comments

Comments
 (0)