📜  两层和三层数据库架构的区别

📅  最后修改于: 2021-09-15 01:41:46             🧑  作者: Mango

1. 两层数据库架构——
在两层中,应用程序逻辑要么隐藏在客户端的用户界面中,要么隐藏在服务器的数据库中(或两者兼有)。对于两层客户端/服务器架构,用户系统界面通常位于用户的桌面环境中,而数据库管理服务通常位于服务器中,服务器是为许多客户端提供服务的更强大的机器。

2. 三层数据库架构——
在三层中,应用程序逻辑或进程位于中间层,它与数据和用户界面分离。三层系统更具可扩展性、健壮性和灵活性。此外,他们可以集成来自多个来源的数据。在三层架构中,在用户系统界面客户端环境和数据库管理服务器环境之间增加了一个中间层。有多种实现此中间层的方法,例如事务处理监视器、消息服务器或应用程序服务器。两层和三层数据库架构的区别

S.NO Two-Tier Database Architecture Three-Tier Database Architecture
1 It is a Client-Server Architecture. It is a Web-based application.
2 In two-tier, the application logic is either buried inside the user interface on the client or within the database on the server (or both). In three-tier, the application logic or process resides in the middle-tier, it is separated from the data and the user interface.
3 Two-tier architecture consists of two layers : Client Tier and Database (Data Tier). Three-tier architecture consists of three layers : Client Layer, Business Layer and Data Layer.
4 It is easy to build and maintain. It is complex to build and maintain.
5 Two-tier architecture runs slower. Three-tier architecture runs faster.
6 It is less secured as client can communicate with database directly. It is secured as client is not allowed to communicate with database directly.
7 It results in performance loss whenever the users increase rapidly. It results in performance loss whenever the system is run on Internet but gives more performance than two-tier architecture.
8 Example – Contact Management System created using MS-Access or Railway Reservation System, etc. Example – Designing registration form which contains text box, label, button or a large website on the Internet, etc.