views:

282

answers:

3

We have a web reporting application that was built with cgi (C/C++) 10 years back. Due to performance and security issues, it needs to be rearchitectured. What could be the best technology solution to re-engineer the cgi based architecture?

+1  A: 
andy
+1  A: 

You're asking a big question, which will involve considering tons of factors, that will be difficult to address in a forum like stackoverflow.com.

For a cautionery note, see Chad Fowler's The Big Rewrite for why you really need to tread carefully.

To speak directly to your choice between servlets and CGI, it probably gets down to a choice between how you want your web server to handle concurrent HTTP requests. If you want to have multiple threads handle them in a single process, then you should go with servlets. You might want a J2EE or .NET for your web application. If you want to fork off different processes for each request (or reuse a pool of processes), then 'CGI' is the way to go. LAMP stacks built on a language like Perl have supported a multi-process architecture, though as I understand it, you don't have to choose CGI per se.

Perhaps the question that you need to ask is whether you want to adopt a 'shared-nothing' architecture for your re-engineering?

Alan
+1  A: 

with FCGI, you can do CGI servlets.

The only difference between a CGI script and a servlet really is servlets are persistent and dispatch calls fed through them, where as CGI scripts are executed on a call-by-call basis.

With a bit of work you could get a nice multithreaded FCGI servlet that just acts as a delegation for all your existing C/C++ CGI code.

Kent Fredric
+1 FastCGI does not have performance limitations.
Petr Gladkikh