I'm currently building a web application that needs to access a (really) big database of strings and compare them to a given 'request string' - This has to be done over and over again using different comparison methods (number of identical words, order of words...) and should be scalable and, more important, fast.
I thought about about implementing the comparison method itself in C, because it's obviously much faster than interpreted, though more 'webby' languages like PHP. This brought me to three questions:
1) How am I supposed to 'connect' the C application to the web server (currently Apache)? I thought about the usual CGI-way, but because of its need to create one new process per request it would be less scalable and fast - at least that's what I read about it.
2) Which database technology is best to use with C for this use-case?
3) Last but not least, do you think it's worth the struggle or would it be enough to go the usual way by building a PHP-Script that connects to a MySQL database - how big is the speed difference?
Thanks in advance, David