How to store user-specific data from Android in Google App Engine Datastore. Ancestor or not?

446 views Asked by At

I currently have an Android app which uses 3 SQLite database tables and I want to store this data on the cloud in my Java-based GAE app. It will be used as backup and also, the user will be able to view it in their browser upon logging in. The user is entering data into the Android app so all the data in the 3 tables belongs to that user. Is there a recommended way of storing this type of user-specific data? Should I store user email with each entity in order to identify it or have a User entity as the parent and all the entities belonging to this user as the children? Are there any advantages of using a parent in this case?

2

There are 2 answers

4
Andrei Volgin On BEST ANSWER

It all depends on how many records you have for a single user, how frequently these records are updated, and how you access this data (what kind of queries you need, etc.) So there is no simple and definitive answer to your question.

Most likely, you will be fine with either approach unless you have thousands of records per user and they update them every few minutes, at which point you may run into some limitations.

Note that you don't need to include an email address to identify each record. Typically, you create a user entity first, and then you use an id of this user entity (a Long) to identify all other entities that are related to this user.

0
Ojonugwa Jude Ochalifu On

My two cents.Unlike Sqlite,Google App Engine is not a relational database so saving your SQlite data to GAE won't be a straightforward task.However, you could create an app on GAE where you use the useremail from ur app as the Entity key.You can then retrieve the user specific info based on this key.All(well,the most important thing)you need to do in this case is find a way to send that data from your app to GAE.