大量的PHP数组VS MySQL数据库? [英] Massive PHP array vs MySQL Database?

查看:162
本文介绍了大量的PHP数组VS MySQL数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我辩论,我的头,我是否应该使用一个巨大的,多维数组或MySQL的数据库。我正在开发一个客户端,其业务有很多的产品。在这个多维数组我将包括产品标题,描述,图片链接和类别为每个单独的产品。

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.

我的客户有可能是1000+的产品。我研究过其他类似的问题,许多人说,一个数组也许是快,但他们都不是在处理这种规模的数组。

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.

我个人宁愿使用一个数组,因为我与MySQL的知识是极其有限的,但如果它意味着牺牲速度的显著量的话,我宁愿使用的数据库。其中您会考虑我的情况更合适的选择吗?

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. 更好和更方便的操作。

  2. 稳定性,安全性和云功能。

  3. 因为处理一个巨大的数组将成为后一个巨大的痛苦。

此外,观看的数据将与数据库肉眼容易得多。

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

希望这有助于!

这篇关于大量的PHP数组VS MySQL数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆