Using DynamoDB sync operations on versioned data sources in Amazon AppSync
Versioned data sources support Sync operations that allow you to retrieve
all the results from a DynamoDB table and then receive only the data altered since your last
query (the delta updates). When Amazon AppSync receives a request for a Sync
operation, it uses the fields specified in the request to determine if the Base table or the Delta table should be accessed.
-
If the
lastSyncfield is not specified, aScanon the Base table is performed. -
If the
lastSyncfield is specified, but the value is before thecurrent moment - DeltaSyncTTL, aScanon the Base table is performed. -
If the
lastSyncfield is specified, and the value is on or after thecurrent moment - DeltaSyncTTL, aQueryon the Delta table is performed.
Amazon AppSync returns the startedAt field to the response mapping template for
all Sync operations. The startedAt field is the moment, in epoch
milliseconds, when the Sync operation started that you can store locally and
use in another request. If a pagination token was included in the request, this value will
be the same as the one returned by the request for the first page of results.
For information about the format for Sync mapping templates, see the mapping
template reference.