Difference between two tier and three tier database architecture
Two Tier Architecture
There are two layers in two Tier architecture. One is the client layer; another one is a database server. Here Client means a machine, and there is an interface in this machine. This is helping me to fetch the data from this database server, which means some API is running on the client machine,which we call in technical terms API, so that API, an interface, is running here. That API creates a connection to the database through JDBC- ODBC because if this machine and this database server are not necessarily wire, they are not directly connected; maybe the Client is at a different location. The server is at a different location. So firstly, both of them will make a connection and then write a query on the interface. Here query means you must write that you want to fetch a particular data.
The query will go to the database server, and this server will process that query means we wrote an application program; here application program means that you want to fetch a particular data. That program can be in any language, for example, if I am writing in java. That application program will come to the database server, and it will process and execute there because the application program can be any other language; in high language, it means the server will convert it, process it, and whatever data is demanded in that query, that data will be given back to the Client. This is how two-tier architecture works. Two Tier is also called client-server architecture.
Three Tier Architecture
Three Tier architecture means three-layer architecture. First is the application layer, which is called the client layer. The second is a business layer, and the third is a database or data layer. So three tiers will be there. So here, all the client computers interact with the application server, and then the application server will interact with the database server.
Difference between two Tier and three Tier Architecture
Two Tier | Three Tier |
The two-tier architecture is Client-server architecture. | It is used for Web-based applications. |
The two-tier architecture is easy to build and maintain. | It is complex to build and maintain as compared to Two Tier architecture. |
The execution of Two Tier architecture is prolonged compared to Three Tier architecture. | The execution of Three Tier architecture is faster than Two Tier architecture. |
Two Tier architecture is less secured as the Client can communicate with the database directly. | Itis secure as the Client cannot communicate directly with the database. |