amplify-category-api icon indicating copy to clipboard operation
amplify-category-api copied to clipboard

Customize ds_pk on Delta Sync table created by Amplify

Open naveenkoduri opened this issue 2 years ago • 7 comments

Amplify CLI Version

10.6.2

Question

Currently, we have an Android Amplify app that does Selective Sync from the backend and uses a specific GSI on the base table. So, the base query which uses the base table during the sync is all fine and good.

Now, with respect to delta sync using its Delta Sync table, whenever our app users are most active, this Delta Sync table is just getting throttled despite being an on-demand table as it is designed to use only two keys (for instance, keys are foo-table-2023-07-27 and bar-table-2023-07-27). Keeping the throttling issue aside, the RCU cost incurred for this delta sync table was always huge when the TTL was 27 hours and consumed 99% of our Dynamo DB cost. We reverted the TTL back to 30 min which again triggered the bug which is again cost prohibitive and we worked around that bug. This means we are back to doing a lot of base queries.

That begs the question, Is there a way we can customize the default pk and sk created by Amplify for this Delta Sync table that aligns with our access pattern related to Selective Sync

  • i.e Users always sync ONLY their data using the base query,
  • and also sync ONLY their data from lastSync using the delta query as well?

naveenkoduri avatar Jul 26 '23 19:07 naveenkoduri