• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 149
  • Last Modified:

Performance Question: DB Query versus PHP Script Interpretation

Hello,
I wonder what has the better performance:

scenario 1) store constants (internationalized strings) in a DB and use PHP / SQL to retrieve them

scenario 2) genearate a large php file holding the values in ready to use PHP constants / array.

In other words: is there a performance gain using a "in-php-database" or does interpreting that php file defeat the object.

which has the better performance (response, server-load)?
0
ICa
Asked:
ICa
1 Solution
 
gregoryyoungCommented:
how large of an array are we talking about ? using multiple constant includes as opposed to 1 huge file could help alleviate this (only include what your need) this _should_ be substantially faster.

0
 
kelvinwkwCommented:
if the 1 huge file is to be used by lots of peoples over the internet or network, i'll go for PHP/ SQL
Firstly is because if a PHP / SQL will produce a response to a client with a small file size, only
the required data is attached. Besides that, 1 huge file will create unwanted web server delay (heavy workload),
if lots of requests are send to the web server.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now