tags:

views:

779

answers:

3

What's the difference between these two? Which is better/faster/reliable?

+2  A: 

They are both specifications for plugging a web application into a web server. One glaring difference is that WSGI comes from the Python world, and I believe there are no non-python implementations.

Specifications are generally not comparable based on better/faster/reliable.

Only their implementations are comparable, and I am sure you will find good implementations of both specifications.

Perhaps read and read.

Ali A
+6  A: 

SCGI is a language-neutral means of connecting a front-end web server and a web application. WSGI is a Python-specific interface standard for web applications.

Though they both have roots in CGI, they're rather different in scope and you could indeed quite reasonably use both at once, for example having a mod_scgi on the webserver talk to a WSGI app run as an SCGI server. There are multiple library implementations that will run WSGI applications as SCGI servers for you (eg. wsgitools, cherrypy).

They are both 'reliable', in as much as you can consider a specification reliable as opposed to a particular implementation. These days you would probably write your application as a WSGI callable, and consider the question of deployment separately.

Maybe an Apache+mod_wsgi (embedded) interface might be a bit faster than an Apache+mod_scgi+(SCGI wrapper lib), but in all likelihood it's not going to be hugely different. More valuable is the ability to run the application on a variety of servers, platforms and connection standards.

bobince
+1  A: 

SCGI (like FastCGI) is a (serialized) protocol suitable for inter-process communication between a web-server and a web-application.

WSGI is a Python API, connecting two (or more) Python WSGI-compatible modules inside the same process (Python interpreter). One module represents the web-server (being either a Python in-process web-server implementation or a gateway to a web-server in another process via e.g. SCGI). The other module is or represents the web application. Additionally, zero or more modules between theses two modules, may serve as WSGI "middleware" modules, doing things like session/cookie management, content caching, authentication, etc. The WSGI API uses Python language features like iteration/generators and passing of callable objects between the cooperating WSGI-compatible modules.