N
Nimit
Hi, I wasn't sure which forum this post belongs to, so I've posted it
to a couple forums that I thought may be appropriate.
In giving me advice, please consider me a beginner. Below is a synopsis
of my problem/question:
SOME BACKGROUND:
- I am writing a php based web application.
- There is a very data intensive task I need to do that requires
reading and lookup of a lot of data.
- This data is all stored in a database. If I did the computation
directly from php, then the load on the database is too intensive, and
takes a unacceptable amount of time (over 20 secs) to calculate (I've
already tried this).
- So I thought what I need to do is load all this data into memory,
and then do this operation from there, and this should be a lot faster
than doing lookups on a database.
WHAT I WANT TO DO:
- Write a C/C++ program that is constantly running that is dedicated
to doing this data intensive operation.
- This program would read all the data from the dbase into memory upon
load. Then it would take requests from a PHP script to run the
operation on that data and return the results to the PHP script.
THINGS I'VE LOOKED INTO:
- I know you can write extensions to php in C++
(http://bugs.tutorbuddy.com/php5cpp/php5cpp/) but I don't know if this
is what I want to do because (as far as I understand) an extension is
loaded and unloaded with the script. The C++ program I need has to be
constantly running in the background, taking requests and returning
results.
If anyone has any advice of how I can go about writing this c/c++
program that communicates with a php script or doing something similar,
I would appreciate any help. (even if you think I am using the wrong
technology to accomplish this, I'd like to know) Thank you!
PS- my current apache/php/mysql setup is in Windows, however when this
project goes live, I expect it to be running in unix.
to a couple forums that I thought may be appropriate.
In giving me advice, please consider me a beginner. Below is a synopsis
of my problem/question:
SOME BACKGROUND:
- I am writing a php based web application.
- There is a very data intensive task I need to do that requires
reading and lookup of a lot of data.
- This data is all stored in a database. If I did the computation
directly from php, then the load on the database is too intensive, and
takes a unacceptable amount of time (over 20 secs) to calculate (I've
already tried this).
- So I thought what I need to do is load all this data into memory,
and then do this operation from there, and this should be a lot faster
than doing lookups on a database.
WHAT I WANT TO DO:
- Write a C/C++ program that is constantly running that is dedicated
to doing this data intensive operation.
- This program would read all the data from the dbase into memory upon
load. Then it would take requests from a PHP script to run the
operation on that data and return the results to the PHP script.
THINGS I'VE LOOKED INTO:
- I know you can write extensions to php in C++
(http://bugs.tutorbuddy.com/php5cpp/php5cpp/) but I don't know if this
is what I want to do because (as far as I understand) an extension is
loaded and unloaded with the script. The C++ program I need has to be
constantly running in the background, taking requests and returning
results.
If anyone has any advice of how I can go about writing this c/c++
program that communicates with a php script or doing something similar,
I would appreciate any help. (even if you think I am using the wrong
technology to accomplish this, I'd like to know) Thank you!
PS- my current apache/php/mysql setup is in Windows, however when this
project goes live, I expect it to be running in unix.