Let’s for an example, I created a web application that which the students of College of Technology, Pantnagar use to find their respective marks in different subjects.
The database of marks resides on the local server of College and application resides on client’s(i.e the students) computer. When a student wants to know his marks, he uses the application interface to access his personal account. This program then queries the database and application returns with the respective marks of a particular student.
This is the example of a 2-tier architecture. Here the 2-tiers are:
- Data Server– database serves the data based on the SQL queries i used in my application code.
- Client Application– application on students computer presents the data from database in a readable format.
Now there won’t be a problem until the users were in less numbers, problem arises when the number of students using this application is very large!!
Because every time a student queries the client application, the server has to serve up large queries for the client application to manipulate which is a very hectic task for server as there will be an enormous drain on the n/w resources.
So, now we create a 3-tier architecture by inserting another program at the server level, known as server application. Now the client application will not query the database directly but will first query the server application which will further query the data server.
Now when student wants to know his/her marks the following will occur:
- The student asks the client application.
- The client application asks the server application.
- The server application queries the data server.
- The data server serves a record with all the student’s grades.
- The server application does all the calculations to determine the marks.
- The server application sends final marks to the client application.
- The client application displays the final grade for the student.