Is a file faster than reading data from a database?

What is more expensive to do in terms of resources and efficiency, file read / write operations or database read / write operations?

I am using MongoDB with Python. I will prepare about 100 thousand requests per db / file per minute. In addition, the database / file contains about 15,000 documents.

What will be faster? thanks in advance.

+3
source share
5 answers

It depends. If you need to read serial data, the file can be faster, if you need to read random data, the database has better chances to be optimized for your needs.

( - , , , )

- .

+5

, , :

  • MongoDB
  • MongoDB ( "", )
+3

.

+2

, - . , , . , , , , . , .

0

, .. . ( , ).

, , , . , , , . .

You can make a file system as efficient as a database, but this effort comes down to writing a database system yourself.

0
source

Source: https://habr.com/ru/post/1775524/


All Articles