0

I'm creating an app with React native and Amplify datastore. I read in documents that all the data would be downloaded on users devices for auto syncing.

My question is that, if I have a million users in my table, all the data would be downloaded on users device?? If with some configurations, I prevent downloading these data, am I able to search a user in my table? I'm not really sure if all the queries are done through the local storage/db or there are done in the backend with datastore?

Amin
  • 93
  • 1
  • 13

1 Answers1

0

No, all user data will not be downloaded onto all user devices. That would present a number of security and UX problems, to say the least.

For the most part, data will be stored remotely. Your client application(s) can query for the data they need, and Amplify will respond accordingly.

Amplify provides a very robust getting started section in the docs for new users, including guides on how to implement authentication and manage access. Good luck!

Ben Rosen
  • 328
  • 2
  • 9
  • Thank you for your answer. I read the documents but something I unclear to me. It’s written that datastore downloads all datasource into the local db. So for example if I have a table for users profile, all the data would not be sync into the local db? How does datastore query? Does it query into the local db or into the table on cloud? If something exists in the cloud but not in the local db, does it find it? – Amin Dec 29 '20 at 23:27
  • [This page](https://docs.amplify.aws/lib/datastore/how-it-works/q/platform/js) explains in more detail how DataStore works, and includes information on conflict resolution and how data is synced to the cloud. – Ben Rosen Dec 29 '20 at 23:36
  • Datastore is useless as for now. It doesn't provide basic features to support real world app except todo list or notes app. see this issue https://github.com/aws-amplify/amplify-js/issues/7534#issuecomment-760412322 – Yusuf Jan 29 '21 at 09:27