database 数据库与文件系统存储
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38120895/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Database vs File system storage
提问by Sriram
Database ultimately stores the data in files, whereas File system also stores the data in files. In this case what is the difference between DB and File System. Is it in the way it is retrieved or anything else?
数据库最终将数据存储在文件中,而文件系统也将数据存储在文件中。在这种情况下,DB 和文件系统有什么区别。是按照检索方式还是其他方式?
采纳答案by Vicky
A database is generally used for storing related, structured data, with well defined data formats, in an efficient manner for insert, update and/or retrieval (depending on application).
On the other hand, a file system is a more unstructured data store for storing arbitrary, probably unrelated data. The file system is more general, and databases are built on top of the general data storage services provided by file systems. [Quora]
数据库通常用于存储相关的结构化数据,具有明确定义的数据格式,以有效的方式进行插入、更新和/或检索(取决于应用程序)。
另一方面,文件系统是一种更加非结构化的数据存储,用于存储任意的、可能不相关的数据。文件系统更通用,数据库建立在文件系统提供的通用数据存储服务之上。[知乎]
The file system is useful if you are looking for a particular file, as operating systems maintain a sort of index. However, the contents of a txt file won't be indexed, which is one of the main advantages of a database.
如果您要查找特定文件,则文件系统很有用,因为操作系统会维护一种索引。但是,txt 文件的内容不会被索引,这是数据库的主要优点之一。
For very complex operations, the filesystem is likely to be very slow.
对于非常复杂的操作,文件系统可能会非常慢。
Main RDBMS advantages:
主要关系型数据库优势:
Tables are related to each other
SQL query/data processing language
Transaction processing addition to SQL (Transact-SQL)
Server-client implementation with server-side objects like stored procedures, functions, triggers, views, etc.
表是相互关联的
SQL查询/数据处理语言
事务处理附加到 SQL (Transact-SQL)
使用服务器端对象(如存储过程、函数、触发器、视图等)的服务器-客户端实现。
Advantage of the File System over Data base Management System is:
文件系统相对于数据库管理系统的优势在于:
When handling small data sets with arbitrary, probably unrelated data, file is more efficient than database. For simple operations, read, write, file operations are faster and simple.
当处理包含任意的、可能不相关的数据的小数据集时,文件比数据库更有效。对于简单的操作,读、写、文件操作更快更简单。
You can find n number of difference over internet.
您可以在互联网上找到 n 个差异。
回答by Antony
Something one should be aware of is that Unix has what is called an inode limit. If you are storing millions of records then this can be a serious problem. You should run df -i
to view the % used as effectively this is a filesystem file limit - EVEN IF you have plenty of disk space.
应该注意的是,Unix 具有所谓的 inode 限制。如果您要存储数百万条记录,那么这可能是一个严重的问题。您应该运行df -i
以查看有效使用的 %,这是一个文件系统文件限制 - 即使您有足够的磁盘空间。
回答by rashedcs
The difference between file processing system and database management system is as follow:
文件处理系统和数据库管理系统的区别如下:
A file processing system is a collection of programs that store and manage files in computer hard-disk. On the other hand, A database management system is collection of programs that enables to create and maintain a database.
File processing system has more data redundancy, less data redundancy in dbms.
- File processing system provides less flexibility in accessing data, whereas dbms has more flexibility in accessing data.
- File processing system does not provide data consistency, whereas dbms provides data consistency through normalization.
- File processing system is less complex, whereas dbms is more complex.
文件处理系统是在计算机硬盘中存储和管理文件的程序集合。另一方面,数据库管理系统是能够创建和维护数据库的程序的集合。
文件处理系统的数据冗余较多,dbms 中的数据冗余较少。
- 文件处理系统在访问数据方面提供的灵活性较低,而 dbms 在访问数据方面具有更大的灵活性。
- 文件处理系统不提供数据一致性,而 dbms 通过规范化提供数据一致性。
- 文件处理系统不太复杂,而 dbms 更复杂。