为什么要使用MySQL over flatfiles? [英] Why use MySQL over flatfiles?

查看:212
本文介绍了为什么要使用MySQL over flatfiles?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个朋友和我正在辩论他是否应该使用MySQL或flatfile数据库用于他的网站的后端。我告诉他要和MySQL一起去,因为它是结构化的,持有的记录很好,并且是一致的。他另一方面说他宁愿去速度。读取文件比连接MySQL更快得多,它让我想知道他是否是对的。例如,为什么不只为每个表创建一个文件夹,例如: users / groups / posts / ,文件夹中有以ID命名的文件( 1 2 3 ),然后为数据使用如下格式: username:John \\\
password:e2fc714c4727ee9395f324cd2e7f331f \\\
email:example @ example。 com

A friend and I were debating about whether he should use MySQL or a flatfile database for his website's backend. I told him to go with MySQL because it was structured, held records well, and was consistent. He on the other hand said that he would rather go for speed. Reading files is a lot quicker than connecting to MySQL and it made me wonder whether he was right. For example, why not just create a folder for each table, like so: users/ groups/ posts/, within the folders have the files named by ID (1, 2, 3) and then for the data use a format like so: username: John\npassword: e2fc714c4727ee9395f324cd2e7f331f\nemail: example@example.com?

换句话说,MySQL比flatfiles有什么优点?

In other words, what are the advantages of MySQL over flatfiles?

推荐答案


换句话说,MySQL比flatfiles有什么优点?

In other words, what are the advantages of MySQL over flatfiles?

MySQL 提供索引和联接(用于执行性能),事务(用于数据完整性)和 SQL (用于开发性能)。

MySQL offers indexes and joins (for execution performance), transactions (for data integrity) and SQL (for development performance).

您的项目只涉及一个 3 行自足文本文件不需要 MySQL

It your project involves just a 3-line self-sufficient text file, you don't need MySQL.

这篇关于为什么要使用MySQL over flatfiles?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆