I am creating a small web service which will only be accessed by machines, not users that simply takes a query string and makes a few MySQL queries. I decided to code this in PHP because it is simple and easy to write and does its job well. My boss however, wants we to write it as a CGI in C (using FastCGI) because he says it will be faster and use less memory. I'm not so keen on this idea for a few reasons:
But that's just my opinion. What other factors do I need to take in to account? Is C the best tool for this job? Or is PHP?
If speed is your (or your boss's) concern, check out the G-WAN server, which allows allows you to write C scripts. There are some MySQL samples in the forum. It'll be much faster than FastCGI (which has to cross process boundaries via sockets).
Some points about this:
IMHO, if most processing is made by MySQL, there is no need to write this code in C, because difference is negligible, but if there is much processing will be made by your code, it makes sense to listen to your boss and make it in C
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With