简体   繁体   English

JSON vs数据库用于处理大量数据

[英]JSON vs Database for handling large amount of data

Hi I'm very new to this area. 嗨,我是这个领域的新手。

I already have a static data represented by JSON files (and sometimes JSON files are too big so that it's divided into files each of 1 MB) .To load any object we locate first the JSON file then load from it the object data. 我已经有一个由JSON文件表示的静态数据(有时JSON文件太大,因此将其分成1 MB的文件)。要加载任何对象,我们首先找到JSON文件,然后从中加载对象数据。

not sure if this is the right behavior. 不知道这是否是正确的行为。 when u have a large amount of data like this. 当您有大量这样的数据时。 is it better to use database directly(as I think the query time will be better than loading 1MB json file and getting the object) or there're other aspects to consider when deciding json over database other than the data size ? 直接使用数据库会更好吗(因为我认为查询时间会比加载1MB json文件并获取对象要好),或者在决定使用json而不是数据大小时还要考虑其他方面?

Well, it is possible to cut bread with a chainsaw, but a knife is the right tool... 嗯,可以用链锯切面包,但是刀是正确的工具...

JSON (same with XML) is meant for 1) data exchange 2) small static data and generically defined structures. JSON(与XML相同)用于1)数据交换2)小型静态数据和通用定义的结构。 It is not designed to deal with large amount of data . 并非旨在处理大量数据

This depends mainly on the question: What are you doing with the data? 这主要取决于以下问题: 您正在处理数据吗? or How are you reading / filtering / sorting / joining / manipulating ... your data? 您如何阅读/过滤/排序/合并/操作...您的数据?

Clear advise: As you have to grab for tricks already (split JSON in fragments for easier handling) go for the real database! 明确建议:由于您已经掌握了技巧(将JSON拆分为片段以便于处理),请使用真实数据库!

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM