0% found this document useful (0 votes)
63 views32 pages

DBMS - Bba-Unit-1

SLKDFK

Uploaded by

dheeraj.cse
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)
63 views32 pages

DBMS - Bba-Unit-1

SLKDFK

Uploaded by

dheeraj.cse
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/ 32

I.

Introduction to Databases and Transactions


What is a Database System?

A database system is a sophisticated framework


designed to store, manage, and retrieve large volumes of
data electronically. It is a critical component of modern
information systems, enabling businesses and
applications to efficiently process and maintain their
data. The main aim of a database system is to ensure that
data can be organized in a structured format, accessed
easily, and managed in a way that guarantees its integrity,
security, and consistency.

A database system comprises two essential components:

1. The Database:
○ The database is a structured collection of data. It
can be organized in various formats, depending
on the type of database model used (e.g.,
relational, document-based, key-value, etc.). The
database stores data in an organized manner,
allowing users or applications to perform
various operations like adding, retrieving,
updating, and deleting data.
○ Organization of Data: In relational databases,
data is organized into tables, where each table
holds data related to a specific entity (e.g.,
customers, products). In NoSQL databases, data
might be stored as documents, key-value pairs,
or graphs.
2. Database Management System (DBMS):
○ The DBMS is the software that interacts with
users and applications to manage the database.
It provides tools and mechanisms to perform
tasks like defining data structures, querying
data, handling transactions, and managing
access controls.
○ DBMS Responsibilities: The DBMS abstracts the
complexities of data storage and provides a
user-friendly interface for data access and
manipulation. It automates many of the tasks
involved in managing data, ensuring that the
system can handle large amounts of data while
maintaining performance, integrity, and security.
Key Roles of a Database System:

1. Efficient Data Storage and Retrieval:


○ Database systems are designed to handle large
amounts of data efficiently. They use advanced
data structures, indexing, and query
optimization techniques to ensure that data can
be stored and retrieved quickly.
○ Query Processing: Through languages like SQL
(in relational databases), the DBMS allows users
to define, retrieve, and manipulate data with
complex queries that fetch specific records or
perform aggregations across multiple datasets.
2. Data Consistency:
○ A core function of a database system is to
ensure data consistency. This means that data
must remain accurate and reliable, even when
multiple users or applications are accessing and
updating it simultaneously.
○ Consistency Mechanisms: The DBMS uses
constraints, such as primary keys and foreign
keys, to enforce relationships and ensure that
the data adheres to predefined rules. For
instance, if a product is deleted, any orders
related to that product can be adjusted to reflect
this change.
3. Data Security:
○ Database systems provide security features to
ensure that sensitive or critical data is
accessible only to authorized users.
○ Access Control: DBMSs offer role-based access
control, where users are given specific
permissions to access or modify data based on
their roles. For example, a regular user may only
be able to view data, while an administrator has
the authority to make changes.
○ Encryption and Authentication: Many DBMSs
offer encryption for data both in transit and at
rest to protect it from unauthorized access.
Additionally, robust authentication mechanisms
(e.g., password-based or multifactor
authentication) ensure that only legitimate users
can access the system.
4. Concurrent Access:
○ Database systems must handle multiple users
accessing and modifying data concurrently. For
example, in an online shopping platform,
hundreds or even thousands of customers may
place orders at the same time.
○ Concurrency Control: The DBMS uses
techniques such as locking, versioning, and
multiversion concurrency control (MVCC) to
manage concurrent access. These mechanisms
prevent conflicts, such as two users trying to
update the same record simultaneously,
ensuring that all transactions occur in a way that
preserves data consistency.
5. Data Integrity:
○ Maintaining data integrity ensures that the data
is accurate and reliable. This is particularly
important when multiple users or applications
interact with the data simultaneously or when
the system encounters failures (e.g., crashes,
network issues).
○ Transaction Management and ACID Properties:
DBMSs ensure data integrity through
transaction management, using the ACID
properties:
■ Atomicity: Ensures that a transaction is "all
or nothing." Either the entire transaction is
successfully completed, or it is rolled back,
leaving the database unchanged.
■ Consistency: Ensures that the database
remains in a consistent state before and
after a transaction.
■ Isolation: Ensures that concurrent
transactions do not interfere with each
other, maintaining the integrity of individual
operations.
■ Durability: Once a transaction is committed,
the changes are permanent, even in the
event of a system failure.
6. Backup and Recovery:
○ Database systems provide mechanisms for data
backup and recovery to ensure that data is not
lost in the event of system failures, corruption,
or accidental deletions.
○ Recovery Mechanisms: DBMSs use logging and
checkpointing techniques to recover data to a
consistent state if an error occurs. In case of a
crash, the DBMS can use transaction logs to
restore the system to the last known good state.
Examples of Popular DBMS:
1. Oracle: Known for its robustness and scalability,
Oracle is widely used in enterprise environments for
handling large volumes of data and complex
transactions.
2. MySQL: An open-source relational DBMS, MySQL is
popular for web applications, particularly in the
LAMP stack (Linux, Apache, MySQL, PHP).
3. Microsoft SQL Server: A relational DBMS developed
by Microsoft, it is commonly used in enterprise
applications that run on Windows servers.
4. PostgreSQL: Another open-source relational DBMS,
PostgreSQL is known for its advanced features, such
as support for complex queries, foreign keys,
triggers, and custom types.

Purpose of a Database System

A database system plays a crucial role in managing large


volumes of data and ensuring that this data remains secure,
consistent, and available for authorized users and
applications. Here is a detailed explanation of the core
purposes of a database system:
1. Data Organization

One of the primary purposes of a database system is to


organize data in a structured manner. The organization of
data typically involves categorizing it into tables, rows, and
columns (in the case of relational databases). This structure
provides a logical representation of real-world entities,
making it easier to manage and access the data.

● Tables represent entities (e.g., customers, products).


● Rows (Tuples) contain individual records or instances of
these entities (e.g., a specific customer’s details).
● Columns (Attributes) represent the properties of these
entities (e.g., a customer’s name, address, phone
number).

By organizing data systematically, database systems ensure


that users can easily retrieve, update, or delete data without
ambiguity or confusion.
2. Efficient Data Management

Database systems are designed to handle large datasets


and manage the complexities of storing, indexing, and
retrieving data quickly. The system optimizes the performance
of these operations, allowing efficient access and
manipulation of data, even when dealing with massive
amounts of information.

● Efficient Retrieval: Through indexing and query


optimization techniques, the database system can
retrieve specific records from millions or billions of entries
in a fraction of a second.
● Data Redundancy: The system minimizes data
redundancy by organizing data efficiently and using
normalization techniques to avoid unnecessary
duplication.
● Storage Optimization: The DBMS ensures that the data
is stored in a compact format to maximize storage
utilization and speed up retrieval operations.

This level of efficiency is critical in environments where


large-scale operations are necessary, such as in
e-commerce, financial systems, or large enterprises.
3. Data Consistency

is the ability of the database system to maintain


Data consistency

accurate and reliable data across various operations. It


ensures that every change made to the data is accurate,
consistent, and follows the established rules and constraints,
such as data types, relationships, and business logic.

● Data Integrity Constraints: The DBMS enforces rules


such as primary key, foreign key, and unique constraints,
which ensure the integrity of the relationships between
different tables. For instance, if a product is deleted, the
database can update or restrict any orders associated
with that product to maintain consistency.
● Multi-User Environments: In environments where
multiple users access or modify data simultaneously, the
system ensures that data remains consistent, even if
different users are performing concurrent updates or
transactions.
For example, in banking applications, when one user transfers
money, the system ensures that the transaction is reflected in
both accounts (the sender’s and the receiver’s), even if
multiple transactions are happening at once.
4. Concurrent Access

Database systems allow multiple users to access the data


simultaneously without compromising the integrity or
accuracy of the data. This is crucial in environments such as
web applications, where thousands of users may be
interacting with the system at the same time.

● Concurrency Control Mechanisms: The DBMS uses


techniques like locking, multiversion concurrency
control (MVCC), and timestamp ordering to ensure
that concurrent operations (e.g., updates, reads, or
deletes) are properly synchronized. This prevents
situations where two users might try to modify the same
data simultaneously, leading to conflicts or data
corruption.
● Transactions: A sequence of operations performed on
the data is treated as a transaction (e.g., updating an
order, adding a new customer). The DBMS ensures that
transactions occur in isolation from one another, meaning
that one transaction does not interfere with another.

By managing concurrent access effectively, the system can


support multi-user environments, where many users or
applications access and modify the data simultaneously, such
as in online shopping platforms or banking systems.
5. Data Security

Databases often store sensitive information (e.g., personal


details, financial data, confidential business records), making
data security a key responsibility of any database system.
Security features ensure that only authorized users can
access, modify, or delete the data, preventing unauthorized
access, data breaches, or leaks.

● Access Control: Database systems implement


role-based access control (RBAC), where different
users are assigned specific roles and permissions. For
example, an admin user might have permission to view
and modify all data, whereas a regular user may only
have access to view specific tables or records.
● Encryption: Modern database systems support
encryption of data both in transit (as it moves across the
network) and at rest (when stored on disk), making it
harder for unauthorized users to intercept or steal the
data.
● Authentication: The system enforces strong
authentication methods, such as passwords, multifactor
authentication (MFA), and token-based access, to ensure
that only legitimate users gain access.

By implementing these security features, the DBMS helps


organizations comply with regulations like GDPR, HIPAA, and
other data privacy laws, which mandate the protection of
sensitive data.
6. Transaction Management

Database systems manage operations in groups, called


transactions, to ensure that the database remains
consistent, even in the event of failures like power outages,
hardware crashes, or network issues.

● Transactions: A transaction is a set of operations that


are performed together as a single unit of work. For
example, transferring money from one account to
another involves two operations—debiting one account
and crediting another. The database system ensures that
either both operations succeed or neither is applied.
● ACID Properties: Transaction management relies on the
ACID properties:
○ Atomicity: Transactions are all or nothing. If any
part of the transaction fails, the entire transaction is
rolled back, and the database remains unchanged.
○ Consistency: Every transaction must bring the
database from one valid state to another, preserving
data integrity constraints.
○ Isolation: Transactions are isolated from one
another, meaning that the partial effects of an
ongoing transaction are not visible to other
transactions.
○ Durability: Once a transaction is committed, its
changes are permanent and will not be lost, even in
the event of a system failure.

Transaction management ensures that the database remains


in a consistent state, even in complex and failure-prone
environments.

Summary:

The purpose of a database system can be summarized as


follows:

1. Data Organization: Structure data in a logical and easily


accessible format.
2. Efficient Data Management: Handle large datasets and
optimize retrieval and storage operations.
3. Data Consistency: Maintain accurate and consistent
data across various operations and users.
4. Concurrent Access: Allow multiple users to access and
modify data simultaneously without conflicts.
5. Data Security: Protect sensitive data from unauthorized
access or breaches.
6. Transaction Management: Ensure that data remains
consistent and reliable through the management of
transactions, following the ACID principles.
Together, these functions make database systems vital for
managing modern, large-scale applications in various
domains such as finance, healthcare, education, e-commerce,
and more.

1.

View of Data

A database provides three distinct levels of abstraction for


viewing and interacting with data:

1. Physical Level: This is the lowest level of data


abstraction and deals with the physical storage of data
on hardware (e.g., hard drives, SSDs). It describes how
the data is actually stored, including file structures and
indexing techniques.
2. Logical Level: The logical level focuses on the structure
of the database, describing the types of data stored and
the relationships between them. For instance, at this
level, you would see tables, columns, and the
relationships between them (e.g., customer and order
tables). It provides an overall description of the database
but abstracts away from how the data is stored
physically.
3. View Level: The highest level of abstraction, the view
level presents only a portion of the database relevant to
particular users. For example, a user may only see
customer names and order history, while the database
contains much more data. This level helps tailor the
interface for different user roles and needs.

Relational Databases

A relational database is a type of database that stores data


in a structured format, using tables. Each table is a collection
of rows (also known as tuples) and columns (referred to as
attributes), and these tables are related to one another
through keys (primary and foreign keys).

Key features of a relational database:

● Tables (Relations): Data is stored in rows and columns.


Each table typically corresponds to a real-world entity,
such as customers or orders.
● Structured Query Language (SQL): SQL is the
language used to interact with a relational database. It
allows users to create, modify, query, and manage data.
● Data Integrity: Relational databases ensure integrity
through constraints like primary keys (unique identifiers
for rows) and foreign keys (which establish relationships
between tables).
● Normalization: This process reduces redundancy and
improves efficiency by organizing data into related tables.

Popular relational databases include MySQL, PostgreSQL,


Oracle, and SQL Server.
Database Architecture

Database architecture defines how a database system is


organized and how its various components interact. Common
architectures include:

1. Single-tier architecture: In this architecture, the DBMS


and the database are located on the same machine. This
is suitable for smaller applications but lacks scalability.
2. Two-tier architecture: In this client-server model, the
database server hosts the DBMS, and client applications
interact with the database through the server. The client
can issue queries, and the server processes them.
3. Three-tier architecture: In this model, an additional
middle tier (application server) sits between the client
and the database. This middle tier handles business logic
and can communicate with multiple databases. It
enhances scalability, security, and performance. This is
common in large-scale, distributed applications.

Transaction Management

A transaction is a sequence of operations performed as a


single logical unit of work. Transactions are crucial for
maintaining database consistency, especially when multiple
users or processes are interacting with the database
concurrently.

Transactions follow the ACID properties:


1. Atomicity: Ensures that all operations within a
transaction are completed successfully, or none are
applied (rollback if a failure occurs).
2. Consistency: Ensures that the database moves from
one consistent state to another, adhering to all
constraints (e.g., referential integrity).
3. Isolation: Ensures that the operations of one transaction
are not visible to others until the transaction is complete.
This avoids issues such as dirty reads or lost updates.
4. Durability: Once a transaction has been committed, its
effects are permanent and will survive any subsequent
system failures (e.g., power outages).

Data Models: Detailed Explanation

1. The Importance of Data Models

A data model provides a conceptual framework that


defines how data is structured, stored, and managed in a
database system. It is essentially the blueprint that
guides how data is represented, organized, and related
within a database. Data models play a crucial role in the
database design process and serve several key
purposes:

● Blueprint for Database Design: Data models act as a


foundation for database designers and developers to
build a well-structured and efficient database
system. They define the relationships between data
elements, ensuring a clear understanding of how
data is stored and accessed.
● Facilitating Communication: Data models help bridge
the gap between business stakeholders (e.g.,
managers, executives) and database professionals
(e.g., database administrators, developers). By
providing a high-level, conceptual representation of
data, data models ensure that everyone involved in
the project understands how data will be used,
stored, and manipulated. This ensures alignment
between business objectives and technical
implementation.
● Maintaining Consistency: Data models ensure that
data is consistently defined and used across the
organization. They provide a clear structure for the
organization’s data, ensuring that the same data is
interpreted in the same way by different users or
systems. For example, if multiple systems within an
organization use customer data, the data model
ensures that "Customer" is consistently defined
across all systems, avoiding confusion or errors.
● Data Interpretation and Processing: Data models
ensure that data can be easily interpreted,
processed, and queried. By defining clear
relationships between entities, attributes, and
constraints, data models ensure that database
queries return meaningful and accurate results.
In summary, a data model is vital in the overall process of
designing, implementing, and managing a database
system, ensuring efficiency, clarity, and consistency in
how data is handled.
2. Basic Building Blocks of Data Models

The basic building blocks of any data model are entities,


attributes, relationships, and constraints. These elements
form the foundation of how data is represented and
organized within a database system.
a. Entities

An entity is any object or concept that exists in the


system and can be distinctly identified. Entities represent
real-world objects or concepts that are stored as records
in the database. For example:

● A Person in a customer database, represented as a


record in a "Customers" table.
● A Product in an inventory management system,
represented as a record in a "Products" table.
● A Place or Location, such as a warehouse, store, or
office.
● Events, such as an order, transaction, or booking.

Entities are typically represented as tables in relational


databases, with each table containing rows (records)
representing individual instances of the entity. Each row
corresponds to a specific entity instance, such as a
particular customer or product.
b. Attributes

An attribute is a characteristic or property that describes


an entity. Attributes represent the data fields or columns
within a database table, containing specific information
about each entity instance. For example:

● For a Person entity, the attributes might include


name, age, address, and email.
● For a Product entity, the attributes might include
product name, price, SKU (Stock Keeping Unit), and
quantity.

Each attribute holds a value for the entity instance. For


example, the "Person" entity might have the attribute
"Name," with the value "John Smith" for a specific
record. Attributes help define the details and
characteristics of entities and allow users to query
specific data.
c. Relationships

Relationships define how different entities interact with


each other within the database. They establish
connections between entities, representing associations
or interactions. For example:
● One-to-Many Relationship: A customer can place
many orders, but each order is placed by only one
customer. This relationship is defined between the
"Customer" entity and the "Order" entity.
● Many-to-Many Relationship: In a library database, a
book can be borrowed by multiple borrowers, and
each borrower can borrow multiple books. This type
of relationship is typically represented by creating a
new table (junction or associative table) to handle
the many-to-many relationship between "Books" and
"Borrowers."
● One-to-One Relationship: In some cases, an entity
may have a one-to-one relationship with another
entity. For example, a person might have one driving
license, and each driving license corresponds to
only one person.

Relationship types often include cardinality, which


describes the number of instances of one entity that can
be associated with instances of another entity:

● One-to-One (1:1)
● One-to-Many (1
)
● Many-to-Many (M
)

Relationships in a database system are often represented


by foreign keys. For example, if "Orders" is related to
"Customers," the "Orders" table might have a foreign key
that references the primary key in the "Customers" table,
establishing the link between the two.
d. Constraints

Constraints are rules or restrictions that define the


permissible values or relationships within the data model.
Constraints ensure the accuracy and integrity of the data,
preventing errors or inconsistencies in the system. Key
types of constraints include:

● Primary Key Constraint: A primary key is a unique


identifier for each record in a table. It ensures that no
two records in the table have the same primary key
value. For example, a "Customer ID" in the
"Customers" table would be a primary key, uniquely
identifying each customer.
● Foreign Key Constraint: A foreign key is a field (or
set of fields) in one table that refers to the primary
key in another table. It is used to maintain the
relationship between two tables. For instance, the
"Order" table may have a foreign key that refers to
the "Customer ID" in the "Customer" table,
establishing the link between orders and customers.
● Unique Constraint: Ensures that all values in a
column are distinct and that no duplicates exist. For
example, an email address field in a "Customers"
table might be required to be unique, ensuring that
no two customers share the same email address.
● Not Null Constraint: Ensures that a particular column
cannot have a null (empty) value. For example, in a
"Products" table, the "Product Name" attribute might
be required to have a non-null value, ensuring that
every product has a name.
● Check Constraint: This defines specific conditions
that must be true for data to be inserted into the
table. For example, a check constraint might ensure
that the "Price" attribute in a "Products" table must
always be a positive number.

By applying constraints, the data model ensures that the


data stored in the database adheres to specific rules,
improving data quality and maintaining database
integrity.

Summary of the Basic Building Blocks of Data Models:

1. Entities: Represent real-world objects or concepts


(e.g., person, product, event) that are stored as
records in a database.
2. Attributes: Define the characteristics or properties of
entities (e.g., name, price, age) and are represented
as columns in a table.
3. Relationships: Represent the connections and
interactions between entities (e.g., a customer places
an order), enforcing how data in different tables is
related.
4. Constraints: Define rules that ensure data integrity
and accuracy (e.g., primary key, foreign key, unique
constraints).

These building blocks form the foundation of a data


model and are crucial in designing and implementing a
well-structured, efficient, and reliable database system.

Business Rules in Detail

Business rules are specific policies, constraints, or


guidelines that govern how data is stored, created,
modified, or deleted in a database system. They reflect
the operational requirements and objectives of the
organization. These rules help ensure that the database
system aligns with the real-world processes of the
business, ensuring data integrity and proper workflow.

Business rules are often derived from business


processes, regulations, policies, or best practices. They
act as a foundation for decision-making, automation, and
process control within the database. Business rules can
be enforced using database constraints, triggers, stored
procedures, or application logic.
1. Types of Business Rules

Business rules can be broadly categorized into two


types:
● Data Integrity Rules: These rules ensure that the data
remains accurate, consistent, and reliable. For
example:
○ "A customer ID must be unique."
○ "An employee’s age must be at least 18 years."
● Business Process Rules: These rules define how
data flows through various business processes. For
example:
○ "A customer may place multiple orders."
○ "A product must have at least one supplier."
2. Examples of Business Rules

● "A customer may place multiple orders":

○ In an e-commerce system, this business rule


states that there is a one-to-many relationship
between customers and orders. Each customer
can place multiple orders, but each order
belongs to a single customer. This can be
enforced in the database by having a foreign key
in the "Orders" table that references the
"Customers" table.
● "An employee's age must be at least 18 years":
○ This rule reflects a real-world legal requirement
that restricts employment to individuals who are
at least 18 years old. In the database, this can be
enforced using a check constraint on the
"Employees" table to ensure that the age
column has a value of 18 or higher.
● "A product must have a valid category":
○ This rule enforces that every product in an
inventory system is assigned to a valid category.
This can be implemented using a foreign key
constraint to ensure that the "Products" table
references a valid "Category ID" from the
"Categories" table.
3. Why Business Rules Are Important

● Ensuring Data Integrity:


Business rules maintain the integrity
of the data by ensuring that only valid, consistent,
and accurate data is stored in the database. For
example, a rule that enforces unique customer IDs
ensures that there are no duplicates.
● Aligning with Business Objectives: They ensure that
the database reflects the business's operational
needs, processes, and constraints. This alignment is
critical for the successful implementation of any
database-driven application.
● Automating Business Logic: Business rules can be
embedded directly into the database as constraints
or triggers, automating decision-making and process
control. This reduces manual errors and speeds up
processes.
● Improving Communication: Business rules provide
clear guidelines and expectations for database
designers, developers, and business stakeholders.
They ensure that everyone understands the
constraints and policies governing the data.

Evolution of Data Models in Detail

The evolution of data models reflects changes in how


data is represented, stored, and managed as technology
and business requirements have evolved. Each data
model offers different ways of structuring data, allowing
businesses to choose the model that best fits their
needs.
1. Hierarchical Model

The hierarchical data model is one of the earliest


database models. It organizes data in a tree-like
structure, where each record has a single parent, but a
parent can have multiple children. The relationships
between records are one-to-many (parent-child
relationships).

● Example: In a company database, a single


department may have multiple employees. The
department is the parent entity, and employees are
the child entities.
● Advantages:
○ Simple structure that is easy to understand.
○ Efficient for hierarchical data (e.g.,
organizational charts).
● Disadvantages:
○ Rigid structure; difficult to manage
many-to-many relationships.
○ Limited flexibility in handling complex queries.
2. Network Model

The network data model builds on the hierarchical model


by allowing more complex relationships between entities.
In a network model, data is organized in a graph
structure, where each record can have multiple parent
and child records. This allows for many-to-many
relationships between data.

● Example: In a university database, a student may


enroll in multiple courses, and each course may have
multiple students enrolled. This creates a
many-to-many relationship between "Students" and
"Courses."
● Advantages:
○ Flexible representation of complex relationships.
○ Better for handling many-to-many relationships
compared to the hierarchical model.
● Disadvantages:
○ More complex structure, making the system
harder to implement and manage.
○ Querying the data can be difficult without an
efficient mechanism for navigating the network.
3. Relational Model
The relational data model is the most widely used data
model today. It organizes data into tables (also known as
relations), with rows representing individual records and
columns representing attributes. The relational model
allows for relationships between tables to be defined
through foreign keys and is managed using Structured
Query Language (SQL).

● Example: In an e-commerce database, a "Customers"


table stores customer information, and an "Orders"
table stores order details. A foreign key in the
"Orders" table references the "Customer ID" in the
"Customers" table, establishing the relationship
between a customer and their orders.
● Advantages:
○ Highly flexible and scalable.
○ Supports complex queries and relationships
using SQL.
○ Widely supported by various DBMS like MySQL,
Oracle, PostgreSQL, and SQL Server.
● Disadvantages:
○ Performance may degrade with extremely large
datasets unless well-optimized.
○ Relational databases may not be as efficient for
highly unstructured or semi-structured data.
4. Object-Oriented Model

The object-oriented data model integrates database


concepts with object-oriented programming (OOP). In
this model, data is stored as objects, similar to objects
used in OOP languages (e.g., Java, C++). Objects contain
both data and methods (functions), allowing for more
complex data structures and behaviors.

● Example: In a multimedia database, an object may


represent a "Video" entity, with attributes such as file
name, duration, and resolution, and methods such as
"play" and "pause."
● Advantages:
○ Well-suited for complex data types, such as
multimedia, CAD, or geographic data.
○ Provides better modeling of real-world entities
by combining data and behavior.
○ Encourages reusability and modularity of code.
● Disadvantages:
○ Less mature and less widely adopted than
relational databases.
○ Can be more difficult to manage and query due
to the complex structure of objects.
5. NoSQL and Non-Relational Models

With the rise of big data and cloud computing, NoSQL


models have emerged to handle large-scale,
unstructured, or semi-structured data. These models
prioritize flexibility, scalability, and performance over the
rigid structure of traditional relational databases. Some
common types of NoSQL models include:
● Document-based Model: Data is stored in documents
(e.g., JSON, XML) with flexible schemas. Each
document can have varying structures.
● Key-Value Model: Data is stored as key-value pairs,
ideal for simple lookup operations.
● Column-family Model: Data is organized into rows
and columns, similar to relational models but with
more flexibility in how columns are structured.
● Graph Model: Data is stored in nodes and edges,
making it ideal for representing relationships
between data points, such as social networks.
● Advantages:
○ Highly scalable and performant for large
datasets.
○ Flexible schema, allowing for dynamic changes
in data structure.
● Disadvantages:
○ Lacks the robust querying capabilities of
relational databases.
○ May require more complex management and
application logic to handle data consistency and
integrity.

Summary of Data Model Evolution:

● Hierarchical Model: Simple tree structure, suited for


one-to-many relationships.
● Network Model: Graph structure, supports
many-to-many relationships.
● Relational Model: Table-based, highly flexible and
widely used.
● Object-Oriented Model: Combines data with
behavior, well-suited for complex data types.
● NoSQL Models: Designed for large-scale, flexible,
and semi-structured data.

Each model offers different advantages and limitations,


depending on the specific needs of the application, the
type of data, and the scale of the system.

1. NoSQL Models: Used for handling large, unstructured,


or semi-structured data. Examples include
document-based databases, key-value stores, and
graph databases.

Degrees of Data Abstraction

1. Physical Level: Details how data is physically stored on


hardware.
2. Logical Level: Describes the overall structure of the
database, including data types and relationships between
data.
3. View Level: Defines different perspectives of the data
based on user roles, showing only the information
relevant to their specific needs.

You might also like