Lec-4: 2 tier and 3 tier Architecture with real life examples | Database Management System
Introduction and Channel Request
The video begins with the host introducing the topic of 2 tier and 3 tier architecture in DBMS. They also request viewers to subscribe to their channel and enable notifications.
Introduction and Channel Request
- The host welcomes viewers to Gate Smashers and introduces the topic of 2 tier and 3 tier architecture in DBMS.
- Viewers are requested to subscribe to the channel and enable notifications for updates on new videos.
Explanation of 2 Tier Architecture
The host explains the concept of 2 tier architecture, its layers, and how it works using a real-life example.
Explanation of 2 Tier Architecture
- 2 tier architecture consists of two layers - client layer and database server.
- The client layer is a machine with an interface that allows data retrieval from the database server.
- An API running on the client machine establishes a connection to the database server through JDBC-ODBC.
- Even if the client machine and database server are not directly connected, they can communicate through this connection.
- A query written on the interface is sent to the database server for processing.
- The application program, written in any language like Java, is executed by the database server.
- The server processes the query, converts it if needed, and retrieves the requested data.
- The retrieved data is then sent back to the client.
Example of Indian Railways as 2 Tier Architecture
The host provides an example of Indian Railways as an illustration of a system using 2 tier architecture.
Example of Indian Railways as 2 Tier Architecture
- When booking train tickets online or through a web application, users interact with a client machine.
- The client machine is used by the railway staff to enter passenger information and retrieve train details from the database server.
- The database server processes the request, checks seat availability, and generates a ticket for the user.
- This example demonstrates how 2 tier architecture is utilized in systems like Indian Railways.
Withdrawal of Money from Bank Account
The host mentions a scenario where they want to withdraw ₹10,000 from their bank account.
Withdrawal of Money from Bank Account
- When physically visiting a bank branch to withdraw money, the clerk uses a client machine to enter the necessary information.
- The information is then sent to the server, which contains the account details.
- After processing the request, the server allows for withdrawal based on available funds in the account.
Timestamps are provided for each section as requested.
Checking and Completing Transactions
This section discusses the process of checking and completing transactions in a two-tier architecture.
Checking the Transaction
- The transaction is checked by sending a request to the server.
- The server responds with the necessary information.
Completing the Transaction
- Once the transaction is checked, it is completed or queried.
- The query or transaction is then processed and finalized.
Advantages of Two-Tier Architecture
- Simple architecture with only two layers: maintenance and limited clients.
- Maintenance is easy due to limited clients and database access.
Scalability Issues
- In today's time, scalability becomes a problem as the number of users increases significantly.
- Two-tier architecture fails when there are a large number of users accessing data 24/7 from any location.
Security Concerns
- Direct interaction between clients and databases poses security vulnerabilities.
- Lack of proper security measures in two-tier architecture can lead to potential problems.
Shifting to Three-Tier Architecture for Improved Security and Scalability
This section explains why three-tier architecture is preferred over two-tier architecture due to its enhanced security and scalability features.
Disadvantages of Two-Tier Architecture
- Scalability issues arise when dealing with a large number of users.
- Security vulnerabilities exist due to direct client-database interaction.
Introduction to Three-Tier Architecture
- Three-tier architecture consists of three layers: application/client layer, business layer, and database/data layer.
Application/Client Layer
- Users interact with this layer through interfaces (e.g., web applications).
Business Layer
- Supports the interface by processing queries and requests from clients.
Database/Data Layer
- Stores and manages data required for transactions.
Benefits of Three-Tier Architecture
- Improved security as clients do not directly interact with the database.
- Enhanced scalability to handle a large number of users and data requests.
- Maintenance remains an advantage in three-tier architecture.
Client Layer and Application Interface
This section focuses on the client layer and its role in the three-tier architecture.
Client Layer Overview
- The client layer consists of all users accessing the application interface.
- Users interact with the interface to perform various tasks (e.g., checking train information, banking transactions).
Application Interface
- The interface allows users to connect with the database and retrieve information.
- It supports different programming languages such as Java or PHP.
Support from Business Layer
- The business layer processes queries and requests made through the application interface.
- Queries are executed at this layer before being sent to the database server.
Database Server and Bottleneck Risks
This section discusses the role of the database server in three-tier architecture and potential bottleneck risks.
Role of Database Server
- The database server processes queries received from the business layer.
- It stores and manages data required for transactions.
Bottleneck Risks
- The database server is at risk due to high load from multiple clients requesting query processing simultaneously.
- Excessive load can lead to performance issues or bottlenecks in processing queries.
Understanding the Business Layer and its Advantages
In this section, the speaker explains the concept of the business layer and discusses its advantages in terms of scalability and security.
The Role of the Business Layer
- The business layer acts as an intermediary between the user interface and the database server.
- It processes application programs generated by user interactions with the interface.
- The business layer reduces the load on the database server by handling query processing and data retrieval.
Advantages of the Business Layer
Scalability
- The business layer allows for easy scalability as it can handle queries from multiple users simultaneously.
- A dedicated application server is used to process queries, ensuring efficient query processing for all users.
Security
- The business layer enhances security by acting as a barrier between users and data.
- Users do not directly interact with the data; instead, they interact only through the business layer, which ensures data confidentiality.
Considerations for Maintenance
- Increasing layers in a system, such as adding a business layer, can make maintenance more complex.
- As more layers are added, system complexity increases, which may pose challenges for maintenance.
Retrieving Data from Data Layer to User Interface
This section focuses on how data is retrieved from the data layer and presented to users through the user interface.
Data Retrieval Process
- After processing queries in the business layer, relevant data is obtained from the data layer.
- In relational databases, data is typically stored in tables.
- The retrieved data is then passed back to the business layer for further processing or presentation to users.
User Interface Interaction
- The user interface displays information requested by users in a format familiar to them.
- Users expect their requested information to be shown on the same interface they used for inputting their query.
Advantages and Challenges of the Business Layer
This section discusses the advantages and challenges associated with the business layer.
Advantages
Scalability
- The business layer allows for efficient query processing for multiple users, ensuring scalability.
Security
- The business layer acts as a barrier between users and data, enhancing security by keeping data location hidden from users.
Challenges
Maintenance Complexity
- Adding layers to a system, such as the business layer, can increase system complexity and pose challenges for maintenance.
Conclusion
The transcript provides an understanding of the business layer's role in handling user queries and its advantages in terms of scalability and security. It also highlights the process of retrieving data from the data layer to present it on the user interface. However, it mentions that adding layers can make system maintenance more complex.
New Section Security and Scalability in Web Applications
In this section, the speaker discusses the importance of security and scalability in web applications.
Importance of Security and Scalability
- In today's time, security and scalability are crucial factors to consider in web applications.
- Maintenance is a key aspect, and having sufficient manpower and resources is essential.
- User data should be available 24/7 and secure, as it is the biggest demand from users.
- Regardless of the specific architecture used (e.g., 3-tier), all web applications need to prioritize security and scalability.
Comparison with 2-Tier Architecture
- If certain tasks can be done by physically going to a bank or using services like IRCTC (Indian Railways), it can be considered as a 2-tier architecture.
The transcript provided does not include additional timestamps.