简体   繁体   English

哪种数据类型最适合在GAE数据库中存储文章(文本)

[英]What datatype is the best to store article(text) in GAE database

I plan to make a self-hosted blog. 我计划创建一个自托管博客。 I am using Google App Engine for the hosting. 我正在使用Google App Engine进行托管。

I wanted to know that every 'article' that I store in the database will be of which datatype? 我想知道我存储在数据库中的每个“文章”都属于哪种数据类型? Should it be a simple String? 应该是一个简单的String吗? Or any other specific datatype? 还是其他任何特定的数据类型?

I code in java so answers are expected in java. 我用Java编写代码,因此在Java中需要答案。 Thank you :) 谢谢 :)

From the list of properties and value types you should use Text string (long) if your text is up to 1MB cause the short version is up to 500 characters. 属性和值类型列表中,如果文本最大为1MB,则短文本最多为500个字符,则应使用Text string (long) If your text is going to be more than 1MB you will have to use Blobstore . 如果您的文字超过1MB,则必须使用Blobstore

The String data type has a size limit for persistence to the datastore using JDO. String数据类型具有使用JDO持久保存到数据存储区的大小限制。 I do not know if other datastore interfaces get around this limit. 我不知道其他数据存储接口是否能绕过此限制。

You might want to try the data type com.google.appengine.api.datastore.Text . 您可能需要尝试使用com.google.appengine.api.datastore.Text数据类型。 Have a look at the GAE/J javadoc documentation for further details, so that you can decide whether this data type would be useful for you or not. 请查看GAE / J javadoc文档以获取更多详细信息,以便您可以决定此数据类型是否对您有用。

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

相关问题 将Java对象存储到Oracle数据库的最佳数据类型 - Best datatype to store a java object to Oracle database 在数据库中存储堆栈跟踪的最佳方法是什么 - What is the best way to store stacktrace in database 如何在GAE应用程序中最好地存储凭据? - How to best store credentials in a GAE app? 使用数据存储在Java GAE中存储关系的最佳实践 - Best practice to store relations in Java GAE with datastore 什么是从数据库存储和检索数据的最佳方法 - What is the best way to store and retrieve data from database 在数据库中存储以Java列表表示的“大”数据的最佳实践是什么? - What is a best practice to store 'large' data, represented by List in Java, in database? 存储与数据库连接相关的信息的最佳实践是什么? - What is the best practices to store database connection related information? 什么是将关键字存储在数据库中,与语言无关的最佳方法 - what is the best approach to store keywords inside database, language agnostic 无法使用数据库时存储数据的最佳方法是什么? - What is the best way to store data when a database could not be used? 在 MYSQL 数据库中存储 base64 字符串的最佳方法是什么? - What is the best way to store base64 string in MYSQL database?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM