简体   繁体   English

如何在Google App Engine数据存储区中存储来自Android的用户特定数据。 祖先与否?

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

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. 我目前有一个使用3个SQLite数据库表的Android应用程序,我想将此数据存储在基于Java的GAE应用程序中的云上。 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. 它将用作备份,并且用户将能够在登录时在其浏览器中查看它。用户正在将数据输入Android应用程序,因此3个表中的所有数据均属于该用户。 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? 在这种情况下使用父母有什么好处吗?

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. 通常,首先创建一个用户实体,然后使用该用户实体的ID(长整数)来标识与此用户相关的所有其他实体。

我的两分钱。与Sqlite不同,Google App Engine不是关系数据库,因此将您的SQlite数据保存到GAE并不是一件容易的事。但是,您可以在GAE上创建一个应用程序,在其中您可以使用来自ur app的useremail作为实体键。然后您可以根据此键检索特定于用户的信息。在这种情况下,您需要做的所有(好,最重要的事情)是找到一种方法,将数据从您的应用发送到GAE。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从Android中的Google App Engine数据存储区中获取数据 - how to fetch data from google app engine datastore in android 从Android应用程序将数据存储在App Engine数据存储区中 - Store data in App Engine datastore from an Android app 从谷歌应用引擎数据存储区获取数据到Android应用程序 - Getting data to Android app from google app engine datastore 如何使用带有云端点的Google App Engine从Android设备上的数据存储中检索数据? - How to retrieve data from the datastore on Android device, using Google App Engine with Cloud Endpoints? 如何将数据从Android移动设备发送到Google App Engine数据存储区? - How to send data from Android mobile devices to the Google App Engine datastore? 从Android客户端将图像存储到Blobstore并检索blobkey并上传URL以存储在Datastore中。 - GAE - Store image to Blobstore from android client and retrieve blobkey and upload url to store in Datastore. - GAE 如何使用谷歌应用程序引擎从数据存储区检索信息,并使用Java在Android应用程序的列表视图中显示它? - how to retrieve info from datastore using google app engine and display it in a list view on an android app using java? 如何从Android应用程序和django网站访问一个Cloud Datastore(Google App Engine)? - How to access one Cloud Datastore(Google App Engine) from Android app and django-website? 如何在没有App Engine的情况下在Android中获取Google Cloud Datastore实体? - How to get a Google Cloud Datastore entity in Android without App Engine? 将 android 应用程序与谷歌应用程序引擎数据存储链接 - linking android application with google app engine datastore
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM