-
Notifications
You must be signed in to change notification settings - Fork 23
Wouldn't this be an expensive query? #1
Comments
Hi @nubpro, this is a good observation, let me add some thoughts: DataStore.query always goes against local data, so it is not an expensive operation in terms of network activity. However, the |
@ferdingler Thanks for the reply! Can we expect In other hand, I think there are syncing issue with Datastore, everytime I would hot reload my app in React Native. The |
Hi @nubpro , order preservation is not guaranteed in DataStore.observe. The protocol is focused on convergence and correctness. DataStore.observe reacts to changes that are written to the storage engine. This can be results of base sync, delta sync, mutations or subscriptions. This architecture is what allows the developer to not have to think about the syncing details. I hope this helps clarify! |
Thanks again! Whenever my client is syncing with the backend, then I perform a Therefore, we're always stuck in the loading screen. |
Hi, |
https://github.com/aws-samples/aws-appsync-refarch-offline/blob/master/src/components/Orders/index.js
I noticed that you subscribed to the Order model in line 15 and its purpose is to re-query all the orders again and re-sort them.
So for every new order or changes to an order, you would do this all over again.
Say in a minute, there's over 100 changes to the respective orders, wouldn't this impact the overall performance of the app?
To that, I would like to continue my conversation over from here.
In my usecase, after a user logs out and relogs back in, querying the Order model doesn't yield any results at all. But instead, using the subscription, it would return each and every orders.
For every orders, I had to query the Order model to get all orders again and like the example given, I would re-sort them every time. Isn't that overkill?
The text was updated successfully, but these errors were encountered: