0% found this document useful (0 votes)
12 views

1.2 View of Data, System Architecture and Data Models (3)

Uploaded by

abishekabi200529
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

1.2 View of Data, System Architecture and Data Models (3)

Uploaded by

abishekabi200529
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 65

U23CS404

Database
Management
Systems
Course Outcomes
CO1 Use data models and depict a database system

CO2 Design relations for various business requirements

CO3 Understand the properties of the database and recovery


process

CO4 Understand the optimization techniques in database


storage

CO5 Design non-structured database systems in application


development
MODULE - I
INTRODUCTION TO DATABASES:

Purpose of Database – Types and examples of Databases (RDBMS, NOSQL, In-memory


Databases & Distributed SQL databases)– Relational Database System Architecture - Views of
Data– Schema architecture – Data Independence – Schema and instance- Data Models–Benefits
and Phases of Data Model - ER Diagram - Symbols, Components, Relationships, Weak entities,
Attributes, Cardinality - Extended ER Diagram – Examples- Relational Data Model – Keys -
Relational Algebra-Normalization - 1NF, 2NF, 3NF, BCNF,4NF,5NF Case Study: ER Diagram on
Online Streaming, Movie Ticket Recommendation, Bike Tracking
MODULE - II
SQL & PL/SQL:

SQL Fundamentals – DDL Commands - Create, Drop, Alter, Truncate, Rename, Keys - Primary Key,
Candidate Key, Super Key, Foreign Key – DML Commands – DQL Commands - Select, Insert,
Update, Delete, Any, All, In, Exists, Non-Exists, Union, Intersection, Advanced SQL Features –
Aggregate Functions - SUM, COUNT, AVG, MIN, MAX, EXPLAIN, COALESCE - Clauses – Order By -
Group By, Having, CASE, LIMIT,WITH Clause, Date Functions, String Functions -Subqueries -
Nested, Correlated, JoinsInner, Outer, and Equi-Joins - Order of Execution,Embedded SQL-
Dynamic SQL. Creation and Dropping of Views, Types of Views - Creation and Execution of
Stored Procedures - Cursors - Opening, Fetching, and Closing - Triggers - Creation, Insertion,
Deletion, and Updating Database - Exception Handling - MySQL JDBC Connectivity

Case Study:Online Streaming, Movie Ticket Recommendation, Bike Tracking, Import/Export


Random records from CSV file to MYSQL
MODULE - III
TRANSACTION AND CONCURRENCY CONTROL
Transaction processing - ACID Properties - Failure and Recovery – Schedules – Serializability -
Concurrency Control –Lock-based protocol - Isolation levels - SQL Facilities for concurrency and
recovery - Database Integrity, Security and Authorization.
Case Study:ACID Properties in Online Streaming Database
MODULE - IV
STORAGE & INDEXING:
Overview of Storage Techniques – File organization - RAID –Indexing - Types of ordered indices -
B & B+ tree – Hashing - Static & Dynamic Hashing - Query Processing & Optimization – SQL
Performance Tuning.

Case Study: Indexing in Online Streaming Database to optimize the retrieval of data
MODULE - V
NOSQL:
Need for NO SQL – Characteristics of NOSQL - Key-value database - Columnar Databases -
Apache Cassandra – ClickHouse– Document Databases - MongoDB – CRUD operations with
MongoDB - MongoDB JDBC Connectivity –MongoDB Testing - Graph Databases – Metabase
Case Study: Conversion of Online Streaming Database (RDBMS) to MongoDB
View of Data
A major purpose of a database system is to provide users with an abstract view of the data

STEP 5
It defines the data elements and the relationships
between the data elements DATA MODELS
Physical Data Independence and Logical
Data Independence DATA INDEPENDENCE
Schema - the logical structure of the
database and Data stored in a database at
a particular moment of time is called an
SCHEMAS AND INSTANCES
instance of the database
System hides certain details of
how the data are stored and DATA ABSTRACTION
maintained
Schema

Schema Example
✔ It is the logical structure shows the design of the
of the database . database, it doesn’t show
✔ e.g., the database the data present in those
consists of information tables
about a set of
customers and
accounts and the
relationship between
them.
✔ Analogous to type
information of a variable
in a program
Instances

Instances Example
✔ Data stored in database ✓Course_id :20
at a particular moment ✓Course_name: DBMS
of time is called ✓Department : CSE
instance of database
Quick 2 – Schema and Instance
Identify the different schemas for the railway reservation system.
Quick 2 - Answer
Identify the different schemas for the railway reservation system.

Passenger Schema
Train Schema
Ticket Schema
Booking Schema
Station Schema
Route Schema
Quick 3 –Instance
Identify the values for the given passenger schema. Passenger(PassengerID, Name, EmailID, Phone_Num)
Quick 3 - Answer
Identify the values for the given passenger schema. Passenger(PassengerID, Name, EmailID, Phone_Num)

PassengerID: 001
Name: John Doe
EmailID:[email protected],
Phone_Num: +91-123-456-7890
Data Abstraction
⮚ Hiding irrelevant details from user and providing abstract
view of data to users
⮚ helps in easy and efficient user database interaction
⮚ Database systems are made-up of complex data structures
⮚ Hides complexity from users through levels of abstraction
The three levels of data abstraction
Levels of Abstraction
⮚ Physical level describes how a record (e.g., customer) is stored.
⮚ Logical level describes data stored in database, and the
relationships among the data.
type customer = record
name : string;
street : string;
city : integer;
end;
Levels of Abstraction
View level - application programs hide details of data
types.
Views can also hide information (e.g., salary) for security
purposes.
Levels of Abstraction
At Physical Level
• instructor, department,
or student record can be
described as a block of
consecutive storage locations

At Logical Level
• type definition (type of
data), interrelationship of
the record types is defined
as well

At View Level
• several views of the database
are defined
Schemas
Physical schema: database design at the physical level
✓ how the data stored in blocks of storage is described at this level.
Logical schema: database design at the logical level programmers and
database administrators work at this level,
✓ data can be described as certain types of data records gets stored
in data structures
View Schema - Design of database at view level
✓ This generally describes end user interaction with database systems.
Schema Architecture
Schema Architecture
Mapping is used to transform the request and response
between various database levels of architecture.
➢ Internal Level
The internal level has an internal schema which describes
the physical storage structure of the database.
The internal schema is also known as a physical schema.
Schema Architecture
Conceptual Level
★ The conceptual level describes what data are to be stored in the
database and also describes what relationship exists among those
data.
★ Programmers and database administrators work at this level.

External Level
★ An external schema is also known as view schema.
★ Each view schema describes the database part that a particular user
group is interested and hides the remaining database from that user
group.
Schema Architecture
Data Independence
Data Independence
★ Data Independence is defined as a property of DBMS that
helps you to change the Database schema at one level of a
database system without requiring to change the schema at
the next higher level.
★ Also helps you to keep data separated from all programs
that make use of it.
Data Independence - Types
⮚ 2 types
⮚ Physical Data
Independence
⮚ Logical Data
Independence
Data Independence
Physical Data Independence
➢ Capacity to change the internal schema without having to
change the conceptual schema.
➢ separate conceptual levels from the internal levels
➢ For Example
➢ If we do any changes in the storage size of the database
system server, then the Conceptual structure of the
database will not be affected
Physical Data Independence
Examples of Physical Data
Independence
⮚ Using a new storage device like Hard Drive or Magnetic
Tapes
⮚ Modifying the file organization
technique in the Database
⮚ Switching to different data structures.
⮚ Changing the access method.
⮚ Modifying indexes.
⮚ Changes to compression techniques or
hashing algorithms.
⮚ Change of Location of Database from say C drive to D Drive
Logical Data Independence
➢ able to change the conceptual schema without having to
change the external schema.
➢ used to separate the external level from the conceptual
view.
➢ If we do any changes in the conceptual view of the data,
then the user view of the data would not be affected.
➢ Logical data independence occurs at the user interface
level.
Logical Data Independence
Examples of Logical Data Independence
➢ Due to Logical independence, any of the below change will
not affect the external layer.
➢ Add/Modify/Delete a new attribute, entity or relationship
is possible without a rewrite of existing application
programs
➢ Merging two records into one
➢ Breaking an existing record into two or more records
DBMS Architecture
⮚ Uses programming languages to design a
particular type of software for businesses or
organizations.
⮚ Focuses on designing, developing,
implementing, and maintaining computer
programs that store and organize information
for businesses, agencies, and institutions.
⮚ A database architect develops and implements
software to meet the needs of users
DBMS Architecture
DBMS Architecture
⮚ The architecture of a DBMS can be seen as either single
tier or multi-tier. The tiers are classified as follows
:
⮚ 1-tier architecture
⮚ 2-tier architecture
⮚ 3-tier architecture
⮚ n-tier architecture
1- Tier Architecture
⮚ One-tier architecture involves putting all
of the required components for a software
application or technology on a single
server or platform.
1- Tier Architecture
⮚ Any changes done here will directly be done
on the database itself. It doesn't provide
a handy tool for end users.
⮚ The 1-Tier architecture is used for the
development of the local application, where
programmers can directly communicate with
the database for the quick response.
⮚ These are centralized systems
1- Tier Architecture
2- Tier Architecture
⮚ The two-tier is based on Client-Server architecture.
⮚ The direct communication takes place between client and
server. There is no intermediate between client and server.
⮚ The user interfaces and application programs are run on the
client side.
⮚ The server side is responsible for providing the functionalities
like query processing and transaction management.
2- Tier Architecture
2- Tier Architecture
⮚ Applications on the client end can directly communicate with the
database on the server side. For this interaction, APIs like: ODBC, and
JDBC are used
⮚ To communicate with the DBMS, the client-side application
establishes a connection with the server side
⮚ ODBC –translation layer, used to access the database and the user
interface application
3- Tier Architecture
3- Tier Architecture
⮚ 3-Tier architecture contains another layer between the client and server.
⮚ In this architecture, the client can't directly communicate with the server. application on the
client-end interacts with an application server which further communicates with the database
system.
⮚ The end user has no idea about the existence of the database beyond the application server.
The database also has no idea about any other user beyond the application.
⮚ The 3-Tier architecture is used in the case of large web applications.
3- Tier Architecture
Database (Data) Tier
⮚ database resides along with its query processing languages

Application (Middle) Tier


⮚ the application server and the programs that access the database reside in this layer
⮚ presents an abstracted view of the database to the user

User (Presentation) Tier


⮚ End-users operate on this tier multiple views of the database can be provided by the
application
3- Tier Architecture
n- Tier Architecture
n- Tier Architecture External
Level

User User 2 User


View
1
User 3
n
1 View View ……. View
n
2 3

Conceptual
Level

Internal Level

Database
System
Structure
System
Structure
Database Users
⮚ Users are differentiated by the way they expect to interact with the system
⮚ Application programmers – interact with system through DML calls.
⮚ Sophisticated users – form requests in a database query language.
⮚ Specialized users – write specialized database applications that do not fit into the traditional
data processing framework.
⮚ Naïve users – invoke one of the permanent application programs that have been written
previously E.g. people accessing database over the web, bank tellers, clerical staff
Data Storage and Querying
⮚ A database system is partitioned into modules that deal with each of the responsibilities of
the overall system.
⮚ The functional components of a database system can be broadly divided into the storage
manager and the query processor components.
⮚ Storage manager - provides the interface between the low-level data stored in the database
and the application programs and queries submitted to the system.
Storage Manager
⮚The storage manager components include:

✓ Authorization and integrity manager


✓ Transaction manager
✓ File manager
✓ Buffer manager
⮚ The storage manager implements several data structures:

✓ Data files, which store the database itself.


✓ Data dictionary, which stores metadata about the structure of the database,
✓ Indices, which can provide fast access to data item
Data
Dictionary

Indices
Query Processor
⮚ The query processor components include:
⮚ DDL interpreter, which interprets DDL statements and records the definitions in the data
dictionary.
⮚ DML compiler, which translates DML statements in a query language into an evaluation plan
consisting of low-level instructions that the query evaluation engine understands.
⮚ Query evaluation engine, which executes low level instructions generated by the DML
compiler.
Transaction Management
⮚ A transaction is a collection of operations that performs a single logical function in a database
application.
⮚ Transaction-management component ensures that the database remains in a consistent
(correct) state despite system failures (e.g., power failures and operating system crashes) and
transaction failures.
⮚ Concurrency-control manager controls the interaction among the concurrent transactions, to
ensure the consistency of the database.
Data Models
⮚ It defines how the logical structure of Database is modelled.
⮚ It describes the design of database
⮚ Also, it defines the data elements and the relationships between the data elements and
reflect entities, attributes, relationship among data, constraints etc.
Benefits of Data Models
⮚ A data model helps design the database at the conceptual, physical and logical levels.
⮚ Data Model structure helps to define the relational tables, primary and foreign keys and
stored procedures.
⮚ It is also helpful to identify missing and redundant data.
⮚ Ensures that all data objects required by the database are accurately represented.
⮚ Omission of data will lead to creation of faulty reports and produce incorrect results.
Data Models
Conceptual Data Models
⮚ It defines WHAT a system contains and is typically designed by data architects and business
stakeholders.
⮚ The primary goal is to define the scope and organize business rules and concepts.
Logical Model
It defines HOW a system must be
implemented, without factoring in
how it would be physically
implemented in the DBMS
Logical Model
Physical
Model
Physical
Model

You might also like