1.12
Explain the difference between two-tier and three-tier application architectures. Which is better suited for web applications? Why?
Earlier-generation database applications used a two-tier architecture, where as a three-tier architecture is used by a modern database application.
In a two-tier architecture the application resides at the client machine, and invokes database system functionality at the server machine through query language statements. In a three-tier architecture the client machine acts as merely a front end and does not contain any direct database calls ; the front end communicates with an application server. The application server, in turn, communicates with a database system to access data.
Three-tier applications provide better security as well as better performance than two-tier applications.
Note: Even though the book classifies database applications in to two, the reality is that most famous applications use four-tier architecture. If we take most chatting mobile applications they are a three-tier architecture with a local database such as sqlite for caching the data and accessing it when the mobile is not connected to the internet.