Solved

Performance Question: DB Query versus PHP Script Interpretation

Posted on 2004-07-30
4
143 Views
Last Modified: 2010-04-06
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
Comment
Question by:ICa
4 Comments
 
LVL 37

Accepted Solution

by:
gregoryyoung earned 75 total points
ID: 11699591
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
 
LVL 11

Expert Comment

by:kelvinwkw
ID: 12041194
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
RESTful API no sessions but track a user who doesn't have an account 2 135
Where do I learn ES6? 3 78
Download a website to hdd 2 81
The Best Website Creation Tools 14 75
Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question