存储大量文本数据的最佳方法是什么? Mysql / Json文件?

时间:2021-09-13 17:12:39

I am currently building a web app which will rely on people saving a lot of text information onto the website server, similar to Wikipedia. I was wondering what is the best way to actually store the information which they enter.

我目前正在构建一个Web应用程序,它依赖于人们将大量文本信息保存到网站服务器上,类似于*。我想知道实际存储他们输入的信息的最佳方式是什么。

Lets say as an example someone adds an entry of 5000 words. Shall I just add this into a "text" input or make a JSON file which needs to be read?

让我们说作为一个例子,有人添加5000字的条目。我只需将其添加到“文本”输入中或制作需要读取的JSON文件吗?

I'm quite new to this kind of thing so I want to balance out speed and security.

我对这种事情很陌生,所以我想平衡速度和安全性。

3 个解决方案

#1


1  

Storing it as JSON will be better if you will be using that data later.Which will be easy to process. Wondering which database are you using

如果您稍后将使用该数据,将其存储为JSON会更好。这将很容易处理。想知道你在使用哪个数据库

#2


1  

If you are using MySQL , then you can save it as TEXT data type.

如果您使用的是MySQL,则可以将其另存为TEXT数据类型。

#3


0  

With file like images and big text, the name of the file is usually generated by the system automatically and stored in a database while the file is stored in the normal file system.

对于像图像和大文本这样的文件,文件的名称通常由系统自动生成并存储在数据库中,而文件存储在普通文件系统中。

For example this is a database table for users:

例如,这是用户的数据库表:

╔══════╦═══════════╦══════════════════════╗
║ Name ║  Surname  ║      Descr_file      ║
╠══════╬═══════════╬══════════════════════╣
║ Luca ║ Mc.Donald ║ descr_42312jf234.txt ║
╚══════╩═══════════╩══════════════════════╝

and descr_42312jf234.txt is stored in the file system.

和descr_42312jf234.txt存储在文件系统中。

If you don't need to maintain some structured info in the text file, because is only a description for example, you shouldn't use JSON encoding.

如果您不需要在文本文件中维护一些结构化信息,因为例如只是一个描述,您不应该使用JSON编码。

About security, you can generate very long name, with SHA-2 for example, that are very difficult to be discovered.

关于安全性,您可以生成很长的名称,例如SHA-2,很难被发现。

#1


1  

Storing it as JSON will be better if you will be using that data later.Which will be easy to process. Wondering which database are you using

如果您稍后将使用该数据,将其存储为JSON会更好。这将很容易处理。想知道你在使用哪个数据库

#2


1  

If you are using MySQL , then you can save it as TEXT data type.

如果您使用的是MySQL,则可以将其另存为TEXT数据类型。

#3


0  

With file like images and big text, the name of the file is usually generated by the system automatically and stored in a database while the file is stored in the normal file system.

对于像图像和大文本这样的文件,文件的名称通常由系统自动生成并存储在数据库中,而文件存储在普通文件系统中。

For example this is a database table for users:

例如,这是用户的数据库表:

╔══════╦═══════════╦══════════════════════╗
║ Name ║  Surname  ║      Descr_file      ║
╠══════╬═══════════╬══════════════════════╣
║ Luca ║ Mc.Donald ║ descr_42312jf234.txt ║
╚══════╩═══════════╩══════════════════════╝

and descr_42312jf234.txt is stored in the file system.

和descr_42312jf234.txt存储在文件系统中。

If you don't need to maintain some structured info in the text file, because is only a description for example, you shouldn't use JSON encoding.

如果您不需要在文本文件中维护一些结构化信息,因为例如只是一个描述,您不应该使用JSON编码。

About security, you can generate very long name, with SHA-2 for example, that are very difficult to be discovered.

关于安全性,您可以生成很长的名称,例如SHA-2,很难被发现。