0% found this document useful (0 votes)
54 views19 pages

Basis

Database Management Systems (DBMS) offer advantages like centralized data storage, data integrity, security and accessibility. DBMS also presents challenges like cost, complexity, potential single points of failure, performance overhead, security risks and vendor lock-in that organizations must consider.

Uploaded by

sunny singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views19 pages

Basis

Database Management Systems (DBMS) offer advantages like centralized data storage, data integrity, security and accessibility. DBMS also presents challenges like cost, complexity, potential single points of failure, performance overhead, security risks and vendor lock-in that organizations must consider.

Uploaded by

sunny singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Basis DBMS Approach File System Approach

Meaning DBMS is a collection of data. In The file system is a collection of data.


DBMS, the user is not required to In this system, the user has to write
write the procedures. the procedures for managing the
database.

Sharing of Due to the centralized approach, Data is distributed in many files, and
data data sharing is easy. it may be of different formats, so it
isn't easy to share data.

Data DBMS gives an abstract view of The file system provides the detail of
Abstraction data that hides the details. the data representation and storage
of data.

Security and DBMS provides a good protection It isn't easy to protect a file under the
Protection mechanism. file system.

Recovery DBMS provides a crash recovery The file system doesn't have a crash
Mechanism mechanism, i.e., DBMS protects mechanism, i.e., if the system crashes
the user from system failure. while entering some data, then the
content of the file will be lost.

Manipulation DBMS contains a wide variety of The file system can't efficiently store
Techniques sophisticated techniques to store and retrieve the data.
and retrieve the data.

Concurrency DBMS takes care of Concurrent In the File system, concurrent access
Problems access of data using some form of has many problems like redirecting
locking. the file while deleting some
information or updating some
information.

Where to use Database approach used in large File system approach used in large
systems which interrelate many systems which interrelate many files.
files.

Cost The database system is expensive The file system approach is cheaper
to design. to design.

Data Due to the centralization of the In this, the files and application
Redundancy database, the problems of data programs are created by different
and redundancy and inconsistency are programmers so that there exists a
Inconsistency controlled.
lot of duplication of data which may
lead to inconsistency.

Structure The database structure is complex The file system approach has a
to design. simple structure.

Data In this system, Data Independence In the File system approach, there
Independence exists, and it can be of two types. exists no Data Independence.
o Logical Data Independence
o Physical Data
Independence

Integrity Integrity Constraints are easy to Integrity Constraints are difficult to


Constraints apply. implement in file system.

Data Models In the database approach, 3 types In the file system approach, there is
of data models exist: no concept of data models exists.
o Hierarchal data models
o Network data models
o Relational data models

Flexibility Changes are often a necessity to The flexibility of the system is less as
the content of the data stored in compared to the DBMS approach.
any system, and these changes are
more easily with a database
approach.

Examples Oracle, SQL Server, Sybase etc. Cobol, C++ etc.


Database Management Systems (DBMS) offer numerous advantages and
disadvantages. Let's explore each:

**Advantages of DBMS**:

1. **Data Centralization**:
- DBMS centralizes data storage, providing a single source of truth for the
organization's data.
- This reduces data redundancy and inconsistency, as there is only one copy of
each data item stored in the database.

2. **Data Integrity and Consistency**:


- DBMS ensures data integrity by enforcing integrity constraints (e.g., primary
keys, foreign keys, uniqueness constraints).
- It also maintains data consistency through transaction management and
concurrency control mechanisms.

3. **Data Security**:
- DBMS provides advanced security features such as access control,
authentication, encryption, and auditing to protect data from unauthorized
access, manipulation, or disclosure.
- It allows administrators to define user roles and permissions, restricting
access to sensitive data.

4. **Data Accessibility**:
- DBMS offers powerful query languages (e.g., SQL) and reporting tools for
retrieving, analyzing, and presenting data in various formats and contexts.
- It supports concurrent access by multiple users or applications, enabling
efficient data sharing and collaboration.
5. **Scalability and Performance**:
- DBMS systems are designed to handle large volumes of data and support
high levels of concurrency and throughput.
- They offer optimized data storage and retrieval mechanisms for efficient
performance, even as the database grows in size and complexity.

6. **Data Recovery and Backup**:


- DBMS provides mechanisms for data backup, recovery, and disaster
recovery, ensuring data availability and continuity in case of hardware failures,
system crashes, or other emergencies.
- It supports transaction logging and rollback mechanisms to restore the
database to a consistent state after a failure.

**Disadvantages of DBMS**:

1. **Cost and Complexity**:


- Implementing and managing a DBMS can be costly and complex, requiring
investments in software licenses, hardware infrastructure, training, and
maintenance.
- Organizations may need dedicated personnel with specialized skills to
administer and optimize the database system effectively.

2. **Potential Single Point of Failure**:


- A centralized DBMS can become a single point of failure, leading to
downtime and data loss if the system experiences hardware failures, software
bugs, or security breaches.
- Organizations may implement backup and redundancy measures to mitigate
this risk, but these add complexity and cost to the system.
3. **Performance Overhead**:
- DBMS imposes performance overhead due to its additional layers of
abstraction, query optimization, and transaction management.
- Complex queries or large data sets may result in slower response times and
reduced system performance, especially during peak usage periods.

4. **Data Security Risks**:


- While DBMS provides security features to protect data, it also introduces
security risks such as unauthorized access, SQL injection attacks, and data
breaches.
- Organizations must implement robust security measures and follow best
practices to mitigate these risks and safeguard sensitive data.

5. **Vendor Lock-In**:
- Organizations may face vendor lock-in when using proprietary DBMS
solutions, limiting their flexibility to switch to alternative vendors or migrate to
open-source solutions.
- This dependency on a specific vendor can result in higher costs, limited
customization options, and potential compatibility issues with other systems.

6. **Complexity of Migration and Integration**:


- Migrating from one DBMS to another or integrating with other systems can
be complex and time-consuming, requiring data conversion, schema mapping,
and application reengineering.
- Compatibility issues, data loss, and disruptions to business operations may
occur during the migration or integration process.

In summary, while DBMS offers numerous advantages such as centralized data


storage, data integrity, security, accessibility, scalability, and data recovery, it
also presents challenges such as cost, complexity, potential single points of
failure, performance overhead, security risks, vendor lock-in, and complexity of
migration and integration. Organizations must carefully evaluate these factors
and weigh the pros and cons before adopting a DBMS solution.

Database Management Systems (DBMS) have a structured architecture that


governs how data is stored, accessed, and managed within the system. Let's
explore the structure and architecture of a typical DBMS:

**1. DBMS Structure:**

The structure of a DBMS can be divided into four main components:

- **Users**: These are individuals or applications that interact with the DBMS
to perform various operations such as querying, updating, and managing data.
Users can be categorized into different roles based on their level of access and
privileges, such as administrators, database designers, and end-users.

- **Database Application**: Database applications are software programs or


modules that interface with the DBMS to interact with the database. These
applications can be categorized into different types, including transaction
processing systems, data warehouses, business intelligence tools, and web
applications.
- **DBMS Engine**: The DBMS engine, also known as the database kernel or
database server, is the core component responsible for managing and
controlling access to the database. It includes several sub-components, such as:
- **Query Processor**: This component interprets and executes user queries,
optimizes query execution plans, and retrieves data from the database.
- **Transaction Manager**: The transaction manager ensures the atomicity,
consistency, isolation, and durability (ACID properties) of database transactions
by coordinating their execution and managing concurrency control.
- **Storage Manager**: The storage manager is responsible for managing the
physical storage of data on disk or other storage devices. It handles tasks such
as data allocation, indexing, buffering, caching, and disk I/O operations.

- **Database**: The database is the central repository that stores organized


collections of data, along with metadata (data about data) describing the
structure and properties of the data. Databases are typically organized into
tables (in relational databases), documents (in document-oriented databases),
graphs (in graph databases), or other data structures based on the chosen data
model.

**2. DBMS Architecture:**

The architecture of a DBMS defines the overall design and structure of the
system, including how its various components interact with each other. A
typical DBMS architecture consists of three main layers:

- **External Level (View Level)**:


- This layer represents the user interface or external view of the database seen
by different categories of users.
- Users interact with the database through predefined views or schemas
tailored to their specific needs and preferences.
- Each user or application may have its own customized view of the database,
hiding unnecessary details and providing a simplified interface for data access
and manipulation.

- **Conceptual Level (Logical Level)**:


- This layer represents the logical structure of the database, including its
schemas, tables, relationships, and constraints.
- It defines the conceptual or logical data model used to organize and
represent data in a consistent and meaningful way.
- The conceptual level abstracts away the physical implementation details of
the database, providing a high-level view of the data independent of the
underlying storage mechanisms.

- **Internal Level (Physical Level)**:


- This layer represents the physical storage and organization of data on disk or
other storage devices.
- It includes data structures, storage allocation mechanisms, indexing
techniques, and optimization strategies used to manage the physical storage of
data efficiently.
- The internal level translates the logical data model defined at the conceptual
level into physical data structures and access methods optimized for
performance and scalability.

**Note**: DBMS architectures can vary depending on the specific


implementation and deployment environment. For example, client-server
architectures, distributed architectures, and cloud-based architectures are
common variations used in different DBMS systems.

In summary, the structure and architecture of a DBMS encompass four main


components: users, database applications, DBMS engine, and the database
itself. The architecture defines how these components interact with each other
and how data is organized, stored, and accessed within the system. It provides
a layered approach that separates the external, conceptual, and internal views
of the database, enabling abstraction, flexibility, and scalability in managing
data.

In the context of Database Management Systems (DBMS), there are several


types of models that are commonly used to represent and manage data. Here
are some key types of models in DBMS:

1. **Relational Model**:
- The relational model organizes data into tables (relations) consisting of rows
(tuples) and columns (attributes).
- It establishes relationships between tables using keys, such as primary keys
and foreign keys.
- SQL (Structured Query Language) is commonly used to manipulate and
query relational databases.

2. **Entity-Relationship Model (ER Model)**:


- The ER model represents the entities, attributes, and relationships between
entities in a database.
- Entities are represented as rectangles, attributes as ovals, and relationships
as diamonds.
- It helps in designing the logical structure of a database and defining its
schema.
3. **Object-Oriented Model**:
- The object-oriented model extends the concepts of object-oriented
programming to database design.
- It represents data as objects, with properties (attributes) and methods
(operations).
- This model is suitable for representing complex data structures and
relationships found in object-oriented systems.

4. **Hierarchical Model**:
- The hierarchical model organizes data in a tree-like structure, with parent-
child relationships between data elements.
- It is characterized by a one-to-many relationship between parent and child
records.
- This model is commonly used in hierarchical databases such as XML
(eXtensible Markup Language) databases.

5. **Network Model**:
- The network model extends the hierarchical model by allowing many-to-
many relationships between records.
- It represents data as a collection of records connected in a network-like
structure.
- This model offers more flexibility in representing complex relationships but
can be more difficult to implement and query compared to the relational
model.

6. **Object-Relational Model**:
- The object-relational model combines features of both the relational and
object-oriented models.
- It allows for the storage of complex data types and supports inheritance,
encapsulation, and polymorphism.
- This model bridges the gap between relational databases and object-
oriented programming languages.

7. **Dimensional Model**:
- The dimensional model is used in data warehousing and OLAP (Online
Analytical Processing) systems.
- It organizes data into fact tables containing measures and dimension tables
containing descriptive attributes.
- This model is optimized for analyzing large volumes of data and performing
complex queries for decision support.

8. **Graph Model**:
- The graph model represents data as nodes (entities) and edges
(relationships) in a graph structure.
- It is suitable for modeling complex networks and relationships found in
social networks, recommendation systems, and network analysis.

Each of these models has its own strengths and weaknesses, and the choice of
model depends on factors such as the nature of the data, the requirements of
the application, and the preferences of the database designers.
In the context of databases, a "key" refers to a specific attribute or combination
of attributes that uniquely identifies a record (row) within a table (relation).
Keys are essential for maintaining data integrity and enforcing constraints
within a database. There are several types of keys commonly used in database
management systems (DBMS). Here are some key types:

1. **Primary Key**:
- A primary key is a unique identifier for each record in a table.
- It must contain unique values and cannot have NULL values.
- Every table in a database should have a primary key, and it serves as the
main index for the table.
- Example: EmployeeID in an Employee table.

2. **Composite Key**:
- A composite key is a key composed of multiple attributes (columns) that,
when combined, uniquely identify a record.
- It is used when no single attribute can uniquely identify a record on its own.
- Example: Combination of EmployeeID and DepartmentID in an Employee-
Department table.

3. **Foreign Key**:
- A foreign key is an attribute or set of attributes in one table that refers to
the primary key in another table.
- It establishes a relationship between two tables, known as a parent-child
relationship.
- Foreign keys help maintain referential integrity and enforce constraints
between related tables.
- Example: DepartmentID in an Employee table, referencing the
DepartmentID primary key in a Department table.
4. **Alternate Key**:
- An alternate key is a candidate key that is not chosen as the primary key.
- It can be unique and can serve as an alternate means of identifying records.
- Example: Email address in a User table, if the primary key is UserID.

5. **Candidate Key**:
- A candidate key is an attribute or set of attributes that can uniquely identify
a record within a table.
- It satisfies the uniqueness and minimality constraints required for a primary
key.
- Example: Both EmployeeID and Social Security Number (SSN) could serve as
candidate keys in an Employee table.

6. **Super Key**:
- A super key is a set of attributes that uniquely identifies a record within a
table.
- It may contain more attributes than necessary to uniquely identify records.
- Example: Combination of EmployeeID, FirstName, and LastName in an
Employee table.

Keys play a crucial role in database design, normalization, and optimization.


They ensure data integrity, facilitate efficient data retrieval, and support
relationships between tables. Choosing the appropriate keys is essential for
designing a well-structured and efficient database schema.
Integrity constraints in Database Management Systems (DBMS) are rules that
enforce the accuracy, consistency, and reliability of data stored in a database.
These constraints ensure that data remains valid and meaningful throughout its
lifecycle. Here are some common types of integrity constraints in DBMS:

1. **Entity Integrity Constraint**:


- Entity integrity constraint ensures that every row (record) in a table has a
unique identifier, typically enforced by a primary key.
- It prevents duplicate records and ensures that each record is uniquely
identifiable within the table.

2. **Referential Integrity Constraint**:


- Referential integrity constraint ensures the consistency of relationships
between tables by maintaining referential integrity.
- It requires that foreign key values in one table match the primary key values
in another table.
- It prevents orphaned records by ensuring that foreign key values always
refer to existing primary key values.

3. **Domain Integrity Constraint**:


- Domain integrity constraint ensures that values stored in each column of a
table conform to a predefined set of permissible values or data types.
- It prevents invalid or inappropriate data from being inserted into the
database.
- Examples include data type constraints (e.g., integer, string), range
constraints (e.g., minimum and maximum values), and format constraints (e.g.,
email address, phone number).

4. **Attribute Integrity Constraint**:


- Attribute integrity constraint ensures the integrity of individual attributes or
columns within a table.
- It enforces rules specific to each attribute, such as uniqueness, nullability,
and default values.
- Examples include unique constraints (ensuring uniqueness of values within a
column), not-null constraints (ensuring that a column cannot contain null
values), and default value constraints (providing a default value if no value is
specified).

5. **Business Rules Integrity Constraint**:


- Business rules integrity constraint enforces specific business rules or
requirements that are not captured by other types of constraints.
- It ensures that data in the database adheres to the business logic and
constraints defined by the organization.
- Examples include constraints related to business logic, validation rules, and
regulatory requirements.

Enforcing integrity constraints is essential for maintaining data quality,


consistency, and reliability in a database. DBMS systems use these constraints
to validate data during insertion, updating, and deletion operations, ensuring
that the database remains accurate and reliable over time. Violations of
integrity constraints result in constraint violations errors and prevent invalid
data from being stored in the database.

Relational algebra is a theoretical framework and a formal query language used


to manipulate and retrieve data stored in relational databases. It provides a set
of operations for performing various data manipulation tasks, such as selection,
projection, join, union, intersection, and difference. These operations are
applied to relational tables to derive new tables or results. Relational algebra
serves as the foundation for query languages like SQL (Structured Query
Language) and plays a crucial role in database query optimization and query
processing. Here are some key operations in relational algebra:

1. **Selection (σ)**:
- The selection operation selects rows from a relation (table) that satisfy a
specified condition or predicate.
- It is denoted by the σ symbol and takes the form
σ<sub>condition</sub>(relation).

2. **Projection (π)**:
- The projection operation selects specific columns (attributes) from a relation
while discarding the rest.
- It is denoted by the π symbol and takes the form π<sub>attribute1,
attribute2, ...</sub>(relation).

3. **Union (∪)**:
- The union operation combines the rows of two relations into a single
relation, eliminating duplicate rows.
- It is denoted by the ∪ symbol and takes the form relation<sub>1</sub> ∪
relation<sub>2</sub>.

4. **Intersection (∩)**:
- The intersection operation returns the common rows between two
relations.
- It is denoted by the ∩ symbol and takes the form relation<sub>1</sub> ∩
relation<sub>2</sub>.
5. **Difference (−)**:
- The difference operation returns the rows that are present in one relation
but not in the other.
- It is denoted by the − symbol and takes the form relation<sub>1</sub> -
relation<sub>2</sub>.

6. **Cartesian Product (×)**:


- The Cartesian product operation combines every row of one relation with
every row of another relation, resulting in a new relation with all possible
combinations.
- It is denoted by the × symbol and takes the form relation<sub>1</sub> ×
relation<sub>2</sub>.

7. **Join (⋈)**:
- The join operation combines rows from two relations based on a common
attribute or condition.
- It is denoted by the ⋈ symbol and takes the form relation<sub>1</sub>
⋈<sub>condition</sub> relation<sub>2</sub>.

8. **Division (÷)**:
- The division operation returns rows from one relation that are related to all
rows of another relation.
- It is a less commonly used operation in relational algebra.

Relational algebra provides a formal and mathematical way to express


database queries and transformations, allowing for precise and efficient
manipulation of relational data. It is used by database management systems
internally to optimize queries and process data retrieval operations. While
relational algebra operations are foundational, they are typically abstracted
away in higher-level query languages like SQL, which provide a more intuitive
and user-friendly interface for interacting with databases.

Database recovery refers to the process of restoring a database to a consistent


and usable state after a failure or an unexpected event that has caused data
corruption or loss. The recovery process involves restoring both the data and
the transactional state of the database to ensure that it reflects a consistent
state as if the failure had not occurred. The ACID properties play a crucial role
in database recovery. Let's delve into both concepts:

1. **ACID Properties**:
- ACID is an acronym that stands for Atomicity, Consistency, Isolation, and
Durability. These properties ensure the reliability and integrity of transactions
in a database system:
- **Atomicity**: Transactions are atomic, meaning they are either
completed successfully in their entirety or aborted with no partial changes
applied to the database. Atomicity ensures that transactions are indivisible and
all-or-nothing.
- **Consistency**: Transactions maintain the consistency of the database by
transforming it from one consistent state to another consistent state.
Consistency ensures that the database remains valid and adheres to predefined
constraints and integrity rules.
- **Isolation**: Transactions execute independently of each other, as if they
were executed sequentially, even when executed concurrently. Isolation
prevents interference between transactions and ensures data integrity and
correctness.
- **Durability**: Once a transaction commits and its changes are applied to
the database, they persist even in the event of a system failure. Durability
guarantees that committed transactions survive system crashes or failures and
are not lost.

2. **Database Recovery**:
- Database recovery ensures that the ACID properties are maintained even
after a system failure or crash. The recovery process typically involves the
following steps:
- **Backup**: Regularly back up the database to preserve a copy of the data
in case of failure.
- **Transaction Logging**: Log all changes made by transactions to a
transaction log before applying them to the database. Transaction logs record
the sequence of operations performed by transactions.
- **Checkpointing**: Periodically create checkpoints to save the current
state of the database, including committed transactions and their
corresponding log records.
- **Rollback and Rollforward**: During recovery, analyze the transaction log
to identify incomplete or partially applied transactions. Rollback incomplete
transactions to undo their effects on the database. Rollforward committed
transactions by reapplying their changes from the transaction log to restore the
database to a consistent state.
- **Redo and Undo Logs**: Redo logs contain information about committed
transactions that need to be reapplied during recovery, while undo logs contain
information about transactions that need to be rolled back.
- **Crash Recovery**: When a system failure occurs, initiate crash recovery
to restore the database to a consistent state using the information from the
transaction log and checkpoints.

Database recovery mechanisms ensure data integrity, reliability, and


consistency, allowing databases to recover from failures and maintain the ACID
properties even in adverse conditions. These mechanisms are crucial for
ensuring the reliability and availability of data in database systems.

You might also like