DBMS Unit 6
DBMS Unit 6
Unit VI
User 3
User 1
Processor
Uscd for pertorming
various operations
Memory Disk
Temporary
storage wnile
Data
Storage
operations
aregoiig
on data
e sCasy-s0lutions
Database Management Systems
(SPPU_IT) 53 Quick Read
Ifa processor (or its memory) falls, Any terminal can Node which functions
act as a
as
interference. As more
shared-disk architecture is () Disadvantages
slowed down disk access
CPUs are added, existing CPUs are
.Cost of communication and of non local
increased contention for memory than other two architectures
since sending
because of the is higher
interaction at both ends.
accesses and network bandwidth. data involves software
() Shared Nothing
Disk System
(D) Hierarchical System
(a) Architecture details Architecture details
to reduce the
Interoonnection Network P Processor architecture is attempts
This
D- DiSK such systems yields to
M= Memory complexity of programming where
architectures,
distrlbuted virtual-memory
OO C Local Memory
logically
memory
there is
mapping
a
hardware
single shared memory,
esCasy-solutions
Database ManagementSystems(SPPUIT) Quick Read
Example: For reconstructlon of relatlon completeness is
Partitlon 1: All employees belong to department required. As every tuple must belongs to at least onme
number 10. of the partitlon.
Ri-ODept 10 (EMP) Conslder relation below as R now subdivided in Pi
Partition 2: All employees belong to department Pa, Ps and P In case of complete horizontal fragment
number 20. if relation R contains 50 tuples than total number of
R-ODept 20 (EMP) tuples in below 4 partitions should be 50 or more
Fragment 1
Employee
with Dept. No. < 20
Fragment2
Original relation Original relation
(Employee table)
EmployeeAge
with Dept. No. = 30 (Employee table)
Fragment 3
Employeee
wih Dept. No. = 40
ala Reconstruction
Fragmentation process
Fragment 4
Employees
with dept. no.> 40
Ces easy-solutions
Database Management Systems Qulck Read
(SPPU_IT)
Example: Vertical fragmentation can be specified bu
PROJECT' operation of the relational algebra.
Partition 1:All employees
having Age 18 or less. Example:
Ri-OEmpAgece 1e(EMP) Select Name and address of all students of computer
Partition 2: All employees
below 65. having Age above 18 and branch.
TName,Address (students)
Rz-OEmpAge» 18 AND EmpAge (EMP) (3) Types of vertical fragmentation
« 65
Partition 3: All
employees having Age above 65. o Complete vertical fragmentation
R3-EmpAge >» 65 (EMP) It generates a set of vertical fragments that
include all the attributes of original relation
Fragment 1 and share only primary key of original relation.
EmpAge= 18
o Consider relation with following schema
Fragment 2
o Student (sid, Name, Age, Address, Phone, class,
Employee Emp Age> 18 fees)
table
AND EmpAge < 65 1 Tsid, Name, Address (Students)
Pa Tsid, Age, Phoae (students)
Fragment P3Tsid,dlass, Fees (students)
EmpAge >= 65
(4) Reconstruction
Fig. 15.6: Disjoint horizontal partitioning To reconstruct the original relation weneed to
(4) Reconstruction process for horizontal fragments perform FULL OUTER JOIN ( ) operation on
To reconstruct the fragments.
original
relation we need to
The
perform set UNION (U) operation on fragments. original
relation can be reconstructed if and
only if completeness constraint is satisfied that
The original relation can be reconstructed if and means there should be either one column which is
only if completeness constraint is satisfied. common between two partitions.
Example: Consider relation shown in complete Example:
horizontal partitioning we can reconstruct relation Consider above relation we can reconstruct relation
as it is satisfying completeness constraints as it is
satisfying completeness constraints
R-RURUR,UR, R-PP2Pa
(B) Vertical Fragmentation (C) Mixed (Hybrid) Fragmentation
(1) Introduction
(1) Introduction
We can mix two
Vertical fragmentation divides a relation vertically
horizontal and vertical
types of fragmentation ie.
into group of columns,.
mixed fragmentation. fragmentations yielding a
When each site does need all the attributes
not
of a This
fragmentation is generally used in man
relation, vertical fragmentation is used to fragment applications.
the relation vertically by columns, (2) Overview
It is necessary to include primary key or some Mixed
common candidate key in every vertical fragment to in relation.
fragmentation is group
of columns and row
reconstruct the original relation from the fragments, Mixed fragmentation can be
(2) Overvlew
and 'SELECT operation of the specified by 'PROJEC
relational algebra.
Vertical fragmentation is group of columns in
(3) Example
relation. Mixed fragmentation can be applied to student tabie
for
following student schema;
es0asy-solutions
Quick Read
Management Systems (SPPU_IT) 57
Database
all student's branch details of IT
Student table (d) Fragment 4: Find
Branch.
Sid SName age Branch id Bname
F4Tsid, Branchid, BName
(OBnamee "1T{student))
Student table contains information about student Sid Branchid Branch
and branches associated with particular student. 4 20 T
Branches can be Computer Science (CS) or IT IT
5 20
branch.
20
Table: Student database 6
(4) Reconstruction
Neha 21 4 20 IT Example
fragmentation we will first
To reconstruct above
20 5 20 ITF details of
RaRaj Fiand F2 which will give
find union of
me
all students.
Faarshad23620IT
F1UF2
Student details of all
students in 'CS
(a) Fragment 1: Sid SName Age
Branch. 1 Smriti 20
(OBname= cs(Student)) 24
FiTsid,SName,age 2 Jay
Sid SName Age 3 22
Ashok
1Smriti 20 4 Neha 21
2 Jay 24 5 Raj 20
3 Ashok 22 6 Harshad 23
in 1T of or department in which
2: Student details of all students Now, we will find details
(6) Fragment taking Union of Fs and F+.
Branch. student study by
(OBname= r(student))
F2 TSid, SName, age FaUF
Sid Branchid Bname
Sid SName Age
CS
4 Neha 21 10
20 CS
Raj 10
Harshad 23 10 CS
all student's
branch details ofCS 20 T
(C) Fragment 3: Find
Branch 20
"CS{Stuaent))
BName (OBname =
20 IT
3 S i d , Branchld,
Sid Branchid Branch two tables
main table we Join above
Now to reconstruct
CS common
column.
using Join ( ) with help of'Sid'as
10
Ces easy-S0lutions
Database Management Systems (SPPU TU s8
Quick Read
Web-to-database middleware
passes the query results in HTML
format back to the Web server
The result of the(4)
database query is RDBMS
Database server
displayed in HTML computer passes the query RDBMS
formal results back to
the server
Web-lo-database
middleware
Database)
Fig. 16.1
Cold fusion application middleware helps us in following ways
o Through web pages we can connect to a database easily.
es asysaIouos
59 Quick Read
Database Management Systems (SPPU_IT)
ColdFusion
processes the
Script page and ther
connectS to n e e
sorvices
equesled service
Server Database
computer Script
Client page server
Computer Web serer
-mail
receives
request
systems
HTTP NETWORK Directory
page
Web server
ColdFusion
applicatiopn
systerns
quesy
TCPIP server File
Web browser network systems
HTML
page
COM
Web server HIMC
DCOM
sends the ColdFusion send page
HTML HTML formatted
Web
formatted document to the
Services can serversS
page to the Web server
reside in the
The result of the
Client Computer or in
same
database query is
displayed in HIM other computers
on a network (LAN
format
or TCP/IP)
6
Fig. 16.2: How cold fusion works ?
Scripts are nothing but small programs written in programming languages link C, VB, C++. Script files are used by
function. Client passes parameters to the webservers.
CGI to perform a specific
Application Programming Interfaces (APIs)
efficient and faster than CGl scripts. APls are implemented as shared
APls Web server interfaces are much more
APl and cGl web Server Interfaces.
code or as dynamic-link libraries (DLLs). Thw following Fig. 16.2.3 shows
The API And CGI Web Server Interfaces.
Web
Client server
computer computer
HTTP
API Web-to-
page
Web server database
Web browser
Teques
TCP/IP cGI midtleware
network
RDBMS RDBMS
computer server
Database
Flg. 16.3
Ces CaSy-solutions3
61 Quick Read
Database Management Systems (SPPU_IT)
Mobile Environments
Characteristics of
special characteristics that must be taken into account when designing applications
Mobile devices have
some
MU Mobile Unit
Wireless network
Wireless range
-data packets
Range of
radio signal
uOloeu o
MU
to mobile device or
user
mobility usually always on.
environment,
Applications are designed in wireless
and limited connectivity.
have lower data rate
SPPU-May 18, May 19, Dec.19, 6 Marks In general for cloud computing or for cloud
Ans.: Cloud Database application Cost, Quality, and Resources are basic
parameters which require elasticity.
What is Cloud?
5. Customization
Cloud refers to a network, internet or
There are thousands of users are using cloud at Sam
communication medium through which we can
point of time. This environment requires lot of
access computing resource located at remote
customization for every user for giving data
location. security
and simplicity for accessing data.
Cloud can contain services like email, storage and
a.4 Write a short note on SQLite database.
web conferencing etc.
Cloud Features
SPPU-Dec.17 May 18, Dec: 19,4 Marks
Ans. sQLite Database
1. On demand services/self service
SQLite is a free open souce RDBMS
engine.
On-demand service refers to the service provided by
SQLite is a
self-contained, serverless, zero
cloud computing vendor enables user use cloud
configuration and transactional
SQL embedded
resources on demand whenever they actually need
RDBMS engine.
it
sQLite implements most of the
In on-demand self-service, the user makes use of sQL-92 standard tor
Ces0asy sofutionS
(SPPU_IT) 63
Database Management Systems QuickRead
Education and Training
C programming language
is used to develop SQLite.|
for many different and popular Simple and easy to install and use. Open source,
It has support
like Java, C++, C#, Python, VB, TCI etc. Very small in size. Hence very useful for education
languages
source technology the source code and training
. A s it is an open
available for public. Prototyping and extensions
of SQLite is easily
. I t is very useful
in memory constrained gadgets As it is lightweight, platform independent it is good
as cell phones, PDAs,
and MP3 players.
such for experimenting
Transactions are AClD even ir nterruptea y G o o d file archives
Ceseasy-solutions
falalna Manumant bynluia (6P T) Qulek Rend
A d Nent la nu of kuy valuw palra, Domunts doruments and J50N olbfecta are slmillar to each other
hava olynam auliwm Oher docsumants, arruys etc, can be Ineluded In the fleld
HDBMS mnolouy
with MongoDA wminolouy Valuus,
MDM Documents have followlng advuntagest"
MawgoDn
Due to embedded documents and arrays, Jolns are
Databasn Dalabasa AVoldad, Jence less oxpenslve,
Table Collur ton Document usts dynamle schoma,
Tupla/ow Dorumen n popular programmlng languages documents are
native data types,
Piuld
A MongoDB document Is as follows,
TaleJoin Pmbedded Documents
movle : "Hanuman",
PMmary Key Primary Key (Default key jd Ticket: 100,
provided by mongodb itself) Sereen 02,
Database Server and Cllent
Ces0asy-solutionsS