Friday, 12 September 2014

Diffs

what is difference between servlet and cgi?

CGI :
  1. Written in C, C++, Visual Basic and Perl
  2. Difficult to maintain, non-scalable, non-manageable
  3. Prone to security problems of programming language
  4. Resource intensive and inefficient
  5. Platform and application-specific
  6. Every time a new process begins each time a request is made to CGI program.
  7. A CGI program (and probably also an extensive runtime system or interpreter) needs  to be loaded and started for each CGI request.
  8. CGI handles separate request by separate instances.
Servlet :
  1. Written in Java
  2. Powerful, reliable, and efficient
  3. Improves scalability, reusability (component based)
  4. Leverages built-in security of Java programming language
  5. Platform independent and portable
  6. A Servlet does not run in a separate process. This removes the overhead of creating a new process for each request.
  7. A Servlet stays in memory between requests.
  8. There is only a single instance which answers all requests concurrently. This saves memory and allows  a Servlet to easily manage persistent data.

0 comments:

Post a Comment