何时使用SQL Server或MySQL以及何时自行管理数据

时间:2021-10-18 07:08:22

If I have a small database with fixed table layouts can I get any kind of performance benefit from handling the data myself rather than using a backend like MySQL? What are the benefits to using such a database backend?

如果我有一个带有固定表格布局的小型数据库,我可以从自己处理数据中获得任何类型的性能优势,而不是使用像MySQL这样的后端吗?使用这样的数据库后端有什么好处?

4 个解决方案

#1


2  

Databases provide ACID features (http://en.wikipedia.org/wiki/ACID) which are hard to deliver when rolling your own solution.

数据库提供了ACID功能(http://en.wikipedia.org/wiki/ACID),这些功能在推出自己的解决方案时很难提供。

In addition, databases tend to scale to larger volumes of data with better performance characteristics.

此外,数据库倾向于扩展到具有更好性能特征的更大量数据。

#2


3  

Handling the data yourself usually means saving them in flat file and accessing them with custom code. In this case they are easier to migrate and deploy, sometimes with better performance but not always, and performance should not be a concern for small data set much less the concern.

自己处理数据通常意味着将它们保存在平面文件中并使用自定义代码访问它们。在这种情况下,它们更易于迁移和部署,有时具有更好的性能但并非总是如此,性能不应该是小数据集的关注点,而不是关注点。

Using a database make it harder to corrupt the data when multiple users change the data at the same time, easier to filter/sort the data, easier for other programmers to maintain, more data tools to integrate with (charts, data forms, reports, etc.), data is less likely to be tampered by user, and your hosting company may backup database more frequently then files.

当多个用户同时更改数据时,使用数据库会更难破坏数据,更容易过滤/排序数据,更容易让其他程序员维护,更多数据工具集成(图表,数据表格,报告,数据不太可能被用户篡改,您的托管公司可能比文件更频繁地备份数据库。

#3


1  

Main benefit is automatic data handling - storing, retrieving, querying.

主要好处是自动数据处理 - 存储,检索,查询。

If you only have very small amount of simple data then you can of course just use INI files or Windows registry or just text file. This saves you from having to handle the MySQL installation and configuration and managing.

如果您只有非常少量的简单数据,那么您当然可以使用INI文件或Windows注册表或仅使用文本文件。这使您无需处理MySQL安装和配置以及管理。

#4


1  

Theoretically, you could get more performance for specialized data structures. On the other hand, you have more flexibility wrt data structures with a database.

从理论上讲,您可以获得更多专业数据结构的性能。另一方面,您可以使用数据库更灵活地使用数据结构。

You might want to look into the NoSQL options available.

您可能希望查看可用的NoSQL选项。

#1


2  

Databases provide ACID features (http://en.wikipedia.org/wiki/ACID) which are hard to deliver when rolling your own solution.

数据库提供了ACID功能(http://en.wikipedia.org/wiki/ACID),这些功能在推出自己的解决方案时很难提供。

In addition, databases tend to scale to larger volumes of data with better performance characteristics.

此外,数据库倾向于扩展到具有更好性能特征的更大量数据。

#2


3  

Handling the data yourself usually means saving them in flat file and accessing them with custom code. In this case they are easier to migrate and deploy, sometimes with better performance but not always, and performance should not be a concern for small data set much less the concern.

自己处理数据通常意味着将它们保存在平面文件中并使用自定义代码访问它们。在这种情况下,它们更易于迁移和部署,有时具有更好的性能但并非总是如此,性能不应该是小数据集的关注点,而不是关注点。

Using a database make it harder to corrupt the data when multiple users change the data at the same time, easier to filter/sort the data, easier for other programmers to maintain, more data tools to integrate with (charts, data forms, reports, etc.), data is less likely to be tampered by user, and your hosting company may backup database more frequently then files.

当多个用户同时更改数据时,使用数据库会更难破坏数据,更容易过滤/排序数据,更容易让其他程序员维护,更多数据工具集成(图表,数据表格,报告,数据不太可能被用户篡改,您的托管公司可能比文件更频繁地备份数据库。

#3


1  

Main benefit is automatic data handling - storing, retrieving, querying.

主要好处是自动数据处理 - 存储,检索,查询。

If you only have very small amount of simple data then you can of course just use INI files or Windows registry or just text file. This saves you from having to handle the MySQL installation and configuration and managing.

如果您只有非常少量的简单数据,那么您当然可以使用INI文件或Windows注册表或仅使用文本文件。这使您无需处理MySQL安装和配置以及管理。

#4


1  

Theoretically, you could get more performance for specialized data structures. On the other hand, you have more flexibility wrt data structures with a database.

从理论上讲,您可以获得更多专业数据结构的性能。另一方面,您可以使用数据库更灵活地使用数据结构。

You might want to look into the NoSQL options available.

您可能希望查看可用的NoSQL选项。