Massive PHP array vs MySQL Database?


I’m debating in my head whether I should use a massive, multidimensional array or a database in MySQL. I’m developing for a client whose business has many products. In this multidimensional array I would include the product title, description, image link and categories for each individual product.

My client has perhaps 1000+ products. I’ve researched other similar questions and many of them say that an array is perhaps faster, however none of them are dealing with an array of this scale.

I personally would much rather use an array, because my knowledge with MySQL is extremely limited, but if it means sacrificing a significant amount of speed then I would rather use the database. Which would you consider a more appropriate option for my case?


Just in my honest opinion I would go with a Database. Here is my reasoning.

With a database you will get a small performance loss as connection times, communication, and query times. However, the gain will come from a few aspects.

  1. Far better and easier manipulation.
  2. Stability, Security, and cloud capabilities.
  3. Because dealing with a huge array will become a huge pain in the rear.

Also, viewing the data will be much easier with a database to the naked eye.

Answered By – jjonesdesign

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published