 In this module, I'll talk about the server side programming. The benefit, the biggest benefit of server side programming is obvious that you make changes, you do the maintenance, you do the installation, you do everything at one end, which is the server end. That helps a lot. It results into a thin client and it does not require installation at all the clients. It's easy to maintain and there are many many benefits. Now the standard that the de facto standard for interfacing the web application with the database is CGI common gateway interface. Remember one thing CGI is not a library, it is not a programming paradigm. It is a protocol. It is a protocol and whenever there is a CGI call, a process is spawned, generated. But remember that the server which spawns the process, these processes are not remembered by the server. They cannot be shared by the server. They are closed also, they're terminated also. And by default CGI does not offers distributed processing. But CGI has been around for a while and it has been used and it is in use also. And of course it was followed by fast CGI. Let me go into more details. So this is what I'll be covering in this module, what is CGI, how to execute CGI, step by step, step by step, not in a lot of details, but you will get the idea and the CGI header, which tells that for a certain step, it is an image, it is text, it is HTML, it is code, whatever. The advantages and disadvantages of having CGI and finally the fast or extended CGI. So let's go into more details. So as I said earlier, CGI is not a library, it is a protocol. It means that it is language independent, okay, is a protocol and a library. You can write CGI script in C, you can write CGI script in C++, you can write CGI script in Java also and so on. So it is language independent and CGI enables web servers to launch external programs. What happens is that when I click on a link, traditionally the corresponding server opens a file for me, if it's a text file, but for a CGI environment, when I click on a link and at the other end, I have CGI script, then the server launches that CGI script. And if it computes something, it returns that result as a computed contents of a file to the end user. This is how it works and enables database access from the browser. This is a much better approach than the client side approaches which were covered in the last module. So it helps me get the data from the database from using the CGI script. Remember it is language independent. So how did it works? You invoke the CGI program by a click by loading a page and then you must have the permission to launch the CGI program. The permission is set, then check for authorization if it's needed and prepare the environment variables. And then it outputs and terminates and there is no remembrance, there is no record, there is no memory. The server sends the data and closes the connection. This is a disadvantage that whenever I make a request, I open a connection, I get the data, the connection is closed. I make another request, again make a request, process is spawned, open a connection, get the data and the connection is closed. This is very inefficient way of doing something which is done repeatedly. Of course it will not result in a high performance solution but it offers a solution. And of course whatever is returned the browser displays it on the screen. It could be the contents of a database, it could be the result of certain computation and so on which is done at the server end. Then of course this is the CJ header I was talking about. So it can help if it is HTML, plain text, it could be a GIF, compressed image, it could be a movie, it could be audio and so on. So all those things are included in the header. It is a comprehensive header and that contains all the information which is required for the CGI script to run which I showed you in the last slide. So what are the advantages and disadvantages of having CGI? There are many of such advantages. One, the biggest is the simplicity. It is very simple, it is simple, it is efficient, it is effective and it is not only language independent, it is server independence also. Independent of the server, independent of the language is a protocol, how you do certain things. Okay, and that is built into the browser can support it and it is widely accepted. These are the biggest advantages of CGI scripting. Disadvantages is the server in the middle because everything has to go through the server. Okay, go through the server and that creates a bottleneck. There is a lot of traffic, right? Or if there is a scenario like Yahoo where hundreds and thousands of processes are spawned, there is a lot of congestion that will hurt the performance. And lack the transaction support. Remember, it is stateless, stateless. Server generates new thread for each CGI program which I already mentioned, there could be 100,000 or such of them. There's no built-in security. It's not very secure. These are some of the disadvantages of CGI scripting. So how or what is done to take care of these issues, which is extended or fast CGI. What is there in the extended or fast CGI? It is language independent as before. It is open standard as before as before independent as before, but it is distributed computing. It means that the CGI script can be made to run and retrieve data from not a single database server from different database servers, combine the results and give you higher performance solution, better performance. Remember, high performance is not in the context of high performance computer architecture, but better performance, quick results. Allocating the processes, the programmer can set the processes which will be allocated to the CGI script instead of having a single process spawned for each request. It means it will give better performance instead of doing something repeatedly. So this is all I have for this module. Thank you very much.