I need to know this information please, I use the file() function in PHP which reads an entire file into an array; that file contains serialized objects that I unserialize and use.
On the other hand, I have the option of storing information in MySQL and retrieving it using a query.
Knowing that this operation is expected to be done millions of times a day, is it better for PHP to read and unserialize data from file or from database? I have no statistics in hand 🙁
Thank you in advance.
Database. Database, database, a thousand [or million, in ths case] times database.
The only exception I can think of is that if every request requires every bit of data contained in this file.
MySQL is much more efficient at: