什么阻止我使用独立的JSON文件而不是本地DB?

发布于 2025-02-07 07:40:53 字数 122 浏览 1 评论 0原文

我需要存储我正在编写的本机移动应用程序中的数据,我想知道:'当我只能读/编写JSON文件时,为什么需要打扰DB设置?所有的交互都是基本的,很可能被解析为JSON对象而不是查询。

  • 有什么优势?

I need to store data for a native mobile app I'm writing and I was wondering: 'why do I need to bother with DB setup when I can just read/write a JSON file?. All the interactions are basic and could most likely be parsed as JSON objects rather than queried.

  • what are the advantages?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

孤独岁月 2025-02-14 07:40:53

数据库目的是使用标准化数据或大数据集。如果您知道只有几个属性要读取,并且不会更改,那么JSON可能会更容易,但是如果您有项目列表,DB可以通过索引优化查询或通过多个表确保一致性

DB are intent to work with standardized data or large data sets. If you know that there is only a few properties to read and it's not changing, JSON may be easier, but if you have a list of items, a DB can optimize the queries with index or ensure consistency through multiple tables

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文