Skip to content

[DataStore] Implement mutations in batches or upload data in the backgroundΒ #3434

@kubatatami

Description

@kubatatami

Is your feature request related to a problem? Please describe.

Users open our app once or twice a day. On app startup we fetch data from physical device and save it in DataStore. For each day we may have ~2000 rows to save. We observe that DataStore send mutation queries for each row one by one and only when app is the foreground. Each mutation takes 300-800ms so to send all data to backend we have to keep app open for almost 20 minutes while our user have the app open for a few minutes only. In result we don't have a recent data on the backend and not synced data grows on mobile device.

Describe the solution you'd like

If Amplify SDK send mutation queries in batches (let's say 50 rows per request) then uploading ~2000 rows will be significantly faster and it will solve our issue.

Describe alternatives you've considered

Alternatively, if Amplify SDK let us to upload data when app is in the background it will also solve our issue. Our app keeps BLE connection with external device so it's active in the background for many minutes per day - enough to send all ~2000 rows.

Is the feature request related to any of the existing Amplify categories?

DataStore

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    datastoreIssues related to the DataStore categoryfeature-requestRequest a new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions