DBMS
DBMS
Unit 1
Introduction to DBMS:
A Database Management System (DBMS) is software that is used to store,
retrieve, manage, and manipulate data efficiently. It provides an interface for
users and applications to interact with databases while ensuring data integrity,
security, and consistency.
Disadvantages of DBMS:
1. High Cost of Implementation
2. Complexity
3. Performance Issues
4. Potential Security Risks
5. Data Loss Risk
6. High System Requirements
DBMS Architecture
A Database stores a lot of critical information to access data quickly and
securely. Hence it is important to select the correct architecture for efficient data
management. Database Management System (DBMS) architecture is crucial for
efficient data management and system performance. It helps users to get their
requests done while connecting to the database. It focuses on how the database
is designed, built and maintained, shaping how users access and interact with it.
1-Tier Architecture:
In 1-Tier Architecture the database is directly available to the user, the user can
directly sit on the DBMS and use it that is, the client, server, and Database are
all present on the same machine. This setup is simple and is often used in
personal or standalone applications where the user interacts directly with the
database.
For Example: A Microsoft Excel spreadsheet is a great example of one-tier
architecture.
Advantages of 1-Tier Architecture
Below mentioned are the advantages of 1-Tier Architecture.
Simple Architecture: 1-Tier Architecture is the most simple architecture
to set up, as only a single machine is required to maintain it.
Cost-Effective: No additional hardware is required for implementing 1-
Tier Architecture, which makes it cost-effective.
Easy to Implement: 1-Tier Architecture can be easily deployed, and
hence it is mostly used in small projects.
2-Tier Architecture:
The 2-tier architecture is similar to a basic client-server model . The application
at the client end directly communicates with the database on the server side.
APIs like ODBC and JDBC are used for this interaction. The server side is
responsible for providing query processing and transaction management
functionalities. On the client side, the user interfaces and application programs
are run.
For Example: A Library Management System used in schools or small
organizations is a classic example of two-tier architecture.
1. Client Layer (Tier 1): This is the user interface that library staff or users
interact with. For example they might use a desktop application to search
for books, issue them, or check due dates.
2. Database Layer (Tier 2): The database server stores all the library
records such as book details, user information, and transaction logs.
Advantages of 2-Tier Architecture
Easy to Access: 2-Tier Architecture makes easy access to the database,
which makes fast retrieval.
Scalable: We can scale the database easily, by adding clients or
upgrading hardware.
Low Cost: 2-Tier Architecture is cheaper than 3-Tier Architecture
and Multi-Tier Architecture .
Easy Deployment: 2-Tier Architecture is easier to deploy than 3-Tier
Architecture.
Simple: 2-Tier Architecture is easily understandable as well as simple
because of only two components.
3-Tier Architecture:
In 3-Tier Architecture , there is another layer between the client and the server.
The client does not directly communicate with the server. Instead, it interacts
with an application server which further communicates with the database
system and then the query processing and transaction management takes place.
This intermediate layer acts as a medium for the exchange of partially
processed data between the server and the client.
For Example: E-commerce Store
User: You visit an online store, search for a product and add it to your cart.
Processing: The system checks if the product is in stock, calculates the total
price and applies any discounts.
Database: The product details, your cart and order history are stored in the
database for future reference.
Advantages of 3-Tier Architecture
Enhanced scalability: Scalability is enhanced due to the distributed
deployment of application servers. Now, individual connections need
not be made between the client and server.
Data Integrity: 3-Tier Architecture maintains Data Integrity. Since
there is a middle layer between the client and the server, data corruption
can be avoided/removed.
Security: 3-Tier Architecture Improves Security. This type of model
prevents direct interaction of the client with the server thereby reducing
access to unauthorized data.
Disadvantages of 3-Tier Architecture
More Complex: 3-Tier Architecture is more complex in comparison to
2-Tier Architecture. Communication Points are also doubled in 3-Tier
Architecture.
Difficult to Interact: It becomes difficult for this sort of interaction to
take place due to the presence of middle layers.
What is a Data Model in DBMS
A data model can be defined as an integrated collection of concepts describing
used in early database systems that organize data into a tree-like structure,
into a series of levels or layers, with each layer representing a particular type of
data. The data is stored as records, which are linked together through parent-
child relationships.
2. Network Model
It is another of the many types of data models in dbms. It was introduced in the
1960s by the Database Task Group. Being one of the early data models in
dbms, it organizes data into a more flexible, complex structure than the
structure, where each record can have multiple parent or child records, forming
a network of relationships.
3. Relational Model
The relational model is a type of data model used in database systems that
organizes data into tables, with each table representing a specific entity or
and columns, with each row representing a unique record or instance of the
entity.
4. Object-Oriented Model
One of the various types of data models in dbms follows the paradigms of
instances of a certain class with each having its own methods and attributes.
ER Model
An Entity-Relationship (ER) Model in Database Management Systems
Entity Types:
depends on Orders).
Attributes
Properties that describe an entity.
Age.
Types of Attributes:
Birth).
Relationships
Types of Relationships:
entities.
entities.
Primary Key (PK) & Foreign Key (FK)
o Primary Key (PK): A unique attribute identifying an entity.
o Foreign Key (FK): A reference to the PK of another entity to establish
relationships.
2. Specialization
Definition: The process of creating subclasses from a superclass based
on distinguishing characteristics.
Example:
o Entity: Vehicle
Subclasses: Car, Bike, Truck.
o Here, Vehicle is specialized into Car, Bike, and Truck, each
having unique attributes.
3. Generalization
Definition: The opposite of specialization—combining multiple lower-
level entities into a higher-level entity.
Example:
o Entities: SavingsAccount, CurrentAccount
o Generalized into: Account (Superclass).
4. Categorization (Union)
Definition: When a subclass inherits attributes from multiple
superclasses.
Example:
o Person and Company both can be Customers.
5. Aggregation
Definition: A relationship where an entire relationship acts as an entity.
Example:
o A Project is assigned to multiple Employees, and each Employee
belongs to a Department.
o The Works_On relationship (between Employee and Project) can
itself be considered an entity.