gmail server architecture

3


Gmail server architecture:

Let us try to understand the operations you are doing to check you mails in gmail account or any mail account.

1. First you will open browser, then you enter gmail server address "www.gmail.com" in the address bar.

2. Soon you press "Enter" Key on keyboard. you will observe gmail login page is appeared. Is that logic page HTML code available in your computer? Or is it downloaded from gmail server? It is downloaded from gmail server then you browser renders that html code and displays it to you. Now tell me HTML technology develops what type of application? Web supportive Application.

3. Now, as per next step you will enter your gmail account username and password, and you will click signin button. If the given username and password is correct you will get your inbox mails, else you will get an error page saying that username or password is incorrect.

4. Think what happened in background:
Browser sends the given username and password to gmail server(project). gmail serverreads these values and passes those values to an application running at server side. It is nothing but Servlet, means Web Application.

5. Then servlet passes those values to Database Interaction Application, JDBC program.

6. Now, JDBC program executes SELECT query on DB Login table to check whether user exists with given values or not. If user exists DB returns userid.
The Query would be
select USERID from LOGIN where UNAME=GIVEN_USERNAME and PWD=GIVEN_PASSWORD;

7. Using this returned userid, JDBC program executes another SELECT query on INBOX table to get all mails related to this user. DB sends all mails related to this user to JDBC application. The query would be 
select MAILS from INBOX where USERID=RETURNED_USERID;

8. Then JDBC application sends those mails to servlet.

9. Now the Servlet sends those mails to JSP to format the mails with help of HTML hyperlinks.

10. Using these mails, JSP generates HTML code dynamically and sends that HTML code to servlet.

11. Servlet sends those mails which are formattedin HTML code to the browser.

12. Finally, the browser displays those mails to user.

Below diagram shows all above 12 steps execution:


Conclusions from the above diagram

1. Every real world web project contains below three applications
  • Web supportive application.
  • Web application.
  • Database interaction application.
2. In java we develop above applications by using.
  • html/ applet - to develop web supportive application.
  • Servlet and JSP - to develop web application.
  • JDBC and EJB - to develop Database Interaction Application.
3. In .NET we develop above applications by using 
  • html - to develop web supportive
  • ASP.NET   - to web applications
  • ADO.NET - to develop database Interaction Application.
4. Web supportive application (HTML/Applet) is used
  • For collecting input from end-user by providing GUI then to pass it to web application.
  • For displaying output to end-user by providing Report.
5. Web application (Servlet and JSP technologies) is used for 
  • Processing request and
  • Preparing response.
Servlet role is processing request means:
  • Reading input from network that is sent by end-user via HTML forms, then
  • Executing Business Logic by using this input then.
  • Finally generating output and sending it to JSP.
JSP role is preparing response means:
  • Generating dynamic HTML by using the output given by servlet.
  • Sending the result HTML back to Servlet.
Then servlet sends this response to browser to display this output to end-user.

6.Database Interaction Application (JDBC/EJB technologies) is used for performing CRUD operations on DB.

DB Terminology
C - Create Insert
R - Read Select 
U - Update Update
D - Delete Delete

About the author

Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus. Aenean fermentum, eget tincidunt.

3 comments:

Recent Posts