-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Datastore/feat add per model sync page size #11179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Datastore/feat add per model sync page size #11179
Conversation
on perModelSyncPageSize object if it exists keeping the previous implementation if not
Hi @MixMasterT - thanks for starting this PR. Could you tell us a bit more about your use case that requires this level of granularity?
Would love it if you could expand more on this. For example with specific limitations that you might've ran into. |
No problem. Here is an example: Users, Materials, and ResearchFacilities are fairly standard, smallish data models (< 1kb per record). Now, suppose that the Experiments Table is quite complex and includes a lot of detailed observation data, so a single Experiment may be over 100kb in data. If we have a User who has more than 20 experiments (could be hundreds) shared with her/him, that may cause AppSync to fail with the "Transformation too large" error. Currently, with only a single
Hopefully this description is helpful. Please let me know if it makes sense to you. Thanks! |
Description of changes
This is a DRAFT PR for implementing perModelSyncPageSize.
Currently, it is possible to set the syncPageSize value, but here is no way to set it to a different value for any one specific data model. This proposed solution would allow users to provide a perModelSyncPageSize option in their DataStore config to set different syncPageSize values for different data models.
The perModelSyncPageSize option would be completely optional, so most users could ignore it altogether.
However, this will be very helpful to developers who may have a heavy data model, since the default syncPageSize is 1000 and the max data volume allowed per request over appSync is 1mb.
The intention for this implementation is that users can add a
perModelSyncPageSize
option when configuring DataStore. This would look something like the following (assume the project has three modelsauthors
,readers
, andbooks
, and that some readers have a large number of books, and that the book records can be quite large):Description of how you validated changes
So far the only validation has been to run the tests (with the new tests commented out), and verify that they still all pass.
NOTE: this is a draft PR, and the goal is to confirm the approach. If this approach is agreed upon, I will follow up with test implementation to verify the intended behavior.
Checklist
yarn test
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.