advance dbms concept presented at kantipur city college, kathmand

30
 Advanced DBMS Concepts Raj Kishore ----------------------- D2Hawkeye Services Pvt. Ltd. ISO 9001:2000 Certified

Upload: raj-kishore

Post on 08-Apr-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

8/6/2019 Advance DBMS Concept Presented at Kantipur City College, Kathmand

http://slidepdf.com/reader/full/advance-dbms-concept-presented-at-kantipur-city-college-kathmand 1/30

 Advanced DBMS Concepts

Raj Kishore-----------------------

D2Hawkeye Services Pvt. Ltd.

ISO 9001:2000 Certified

8/6/2019 Advance DBMS Concept Presented at Kantipur City College, Kathmand

http://slidepdf.com/reader/full/advance-dbms-concept-presented-at-kantipur-city-college-kathmand 2/30

Distributed Databases

� Data stored at several locations� Managed by a DBMS that can run

autonomously� Ideally, location of data isunknown to client

� Clients can write Transactions

regardless of where the affecteddata are located

8/6/2019 Advance DBMS Concept Presented at Kantipur City College, Kathmand

http://slidepdf.com/reader/full/advance-dbms-concept-presented-at-kantipur-city-college-kathmand 3/30

Types of Distributed Database

� Homogeneous: Every site runsthe same type of DBMS (All sites

runs on Oracle)� Heterogeneous: Different sitesrun different DBMS (maybeOracle, MSSQL Server, DB/2)

8/6/2019 Advance DBMS Concept Presented at Kantipur City College, Kathmand

http://slidepdf.com/reader/full/advance-dbms-concept-presented-at-kantipur-city-college-kathmand 4/30

Distributed Databases

8/6/2019 Advance DBMS Concept Presented at Kantipur City College, Kathmand

http://slidepdf.com/reader/full/advance-dbms-concept-presented-at-kantipur-city-college-kathmand 5/30

Distributed DBMS Architectures

� Client - Servers:o Client sends query to each database server

in the distributed systemo

Client caches and accumulates responses� Collaborating Server:

o Client sends query to ³nearest´ Servero Server sends query to other Servers, as

requiredo Server sends response to Client

8/6/2019 Advance DBMS Concept Presented at Kantipur City College, Kathmand

http://slidepdf.com/reader/full/advance-dbms-concept-presented-at-kantipur-city-college-kathmand 6/30

Storing the Distributed Data

� In fragments at each siteo Split the data upo Each site stores one or more fragments

� In complete replicas at each siteo Each site stores a replica of the complete

data

� A mixture of fragments and replicaso Each site stores some replicas and/or

fragments or the data

8/6/2019 Advance DBMS Concept Presented at Kantipur City College, Kathmand

http://slidepdf.com/reader/full/advance-dbms-concept-presented-at-kantipur-city-college-kathmand 7/30

 Advantages Distributed DBMS

� Fragmentation (Sub-set Data)o Exploit data access localityo Put data near consumero

Less network traffico Better response timeo Better availabilityo Spread Load

� R eplicated Data (Complete)o Improves availabilityo Disconnected (mobile) operationo R eads are cheaper

8/6/2019 Advance DBMS Concept Presented at Kantipur City College, Kathmand

http://slidepdf.com/reader/full/advance-dbms-concept-presented-at-kantipur-city-college-kathmand 8/30

Fragmentation (Sub-Setting)

� Horizontal ± ³R ow- wise´o rows of the table make up one

fragment

� Vertical ± ³Column- Wise´o columns of the table make up one

fragment

� Selected Tables residing in

selected locations

8/6/2019 Advance DBMS Concept Presented at Kantipur City College, Kathmand

http://slidepdf.com/reader/full/advance-dbms-concept-presented-at-kantipur-city-college-kathmand 9/30

Replication

� Make synchronized orunsynchronized copies of data atdifferent serverso Synchronized: data are always current,

updates are constantly shipped betweenreplicas

o Unsynchronized: data queued up for latersynchronization, good for read-only data

�Increases availability of data� Makes query execution faster

8/6/2019 Advance DBMS Concept Presented at Kantipur City College, Kathmand

http://slidepdf.com/reader/full/advance-dbms-concept-presented-at-kantipur-city-college-kathmand 10/30

Replication Catalogue

� Which objects are being replicated� Where objects are being replicated to� How updates are propagated

� Catalogue is a set of tables that canbe backed up, and recovered (as anyother table)

� These tables are themselves

replicated to each replication siteo No single point of failure in the DistributedDatabase

8/6/2019 Advance DBMS Concept Presented at Kantipur City College, Kathmand

http://slidepdf.com/reader/full/advance-dbms-concept-presented-at-kantipur-city-college-kathmand 11/30

Distributed Transaction

� All data that have been changedmust be propagated before theTransaction commits (Distributed

R eplicated)� Before Transaction can commit, it

obtains locks on all modified copies� Sends lock requests to remote sites,

holds lock� If links or remote sites fail,

Transaction cannot commit untillinks/sites restored

� commit protocol is complex, and

involves many to and fro messages

8/6/2019 Advance DBMS Concept Presented at Kantipur City College, Kathmand

http://slidepdf.com/reader/full/advance-dbms-concept-presented-at-kantipur-city-college-kathmand 12/30

Distributed Locking

� How to manage Locks across manysites?o Centrally: one site does all locking

Vulnerable to single site failureo Primary Copy: all locking for an object

done at the primary copy site for the object R eading requires access to locking site as

well as site which stores objecto Fully Distributed: locking for a copy done

at site where the copy is stored Locks at all sites while writing an object

8/6/2019 Advance DBMS Concept Presented at Kantipur City College, Kathmand

http://slidepdf.com/reader/full/advance-dbms-concept-presented-at-kantipur-city-college-kathmand 13/30

Two- Phase Commit

� Site which originates Transaction is coordinator,other sites involved in Transaction aresubordinates

� When the Transaction needs to Commit:o Coordinator sends ³prepare´ message to

subordinateso Subordinates each force-writes an abort or prepare

Log record, and sends ³yes´ or ³no´ message toCoordinator

o If Coordinator gets unanimous ³yes´ messages,force-writes a commit Log record, and sends

³commit´ message to subordinateso Subordinates force-write abort/commit Log record

accordingly, then send an ³ack´ message toCoordinator

o Coordinator writes end end Log record afterreceiving all acks

8/6/2019 Advance DBMS Concept Presented at Kantipur City College, Kathmand

http://slidepdf.com/reader/full/advance-dbms-concept-presented-at-kantipur-city-college-kathmand 14/30

Parallel Processing

� Parallel processing divides a large taskinto many smaller tasks and executes thesmaller tasks concurrently on several

nodes. As a result, the larger taskcompletes more quickly

� A node is a separate processor, often ona separate machine. Multiple processors,however, can reside on a single machine

8/6/2019 Advance DBMS Concept Presented at Kantipur City College, Kathmand

http://slidepdf.com/reader/full/advance-dbms-concept-presented-at-kantipur-city-college-kathmand 15/30

Sequential Processing of a Single Task

8/6/2019 Advance DBMS Concept Presented at Kantipur City College, Kathmand

http://slidepdf.com/reader/full/advance-dbms-concept-presented-at-kantipur-city-college-kathmand 16/30

Executing Component Tasks in Parallel

8/6/2019 Advance DBMS Concept Presented at Kantipur City College, Kathmand

http://slidepdf.com/reader/full/advance-dbms-concept-presented-at-kantipur-city-college-kathmand 17/30

Problems of Parallel Processing

� Effective implementation of parallelprocessing involves two challenges:o Structuring tasks so some tasks

execute at the same time "in parallel"o Preserving task sequencing for tasks

that must execute serially

8/6/2019 Advance DBMS Concept Presented at Kantipur City College, Kathmand

http://slidepdf.com/reader/full/advance-dbms-concept-presented-at-kantipur-city-college-kathmand 18/30

8/6/2019 Advance DBMS Concept Presented at Kantipur City College, Kathmand

http://slidepdf.com/reader/full/advance-dbms-concept-presented-at-kantipur-city-college-kathmand 19/30

Parallel Processing for SMPs andMPPs

� Parallel processing architecturessupport:o Clustered and massively parallel

processing (MPP) hardware where eachnode has its own memory

o Single memory systems, also known as"symmetric multiprocessing" (SMP)

hardware, where multiple processorsuse one memory resource

8/6/2019 Advance DBMS Concept Presented at Kantipur City College, Kathmand

http://slidepdf.com/reader/full/advance-dbms-concept-presented-at-kantipur-city-college-kathmand 20/30

The Goals of Parallel Processing

� Speedu p is the extent to which morehardware can perform the sametask in less time than the originalsystem

� Scal eu p is the factor that expresseshow much more work can be donein the same time period by a largersystem

8/6/2019 Advance DBMS Concept Presented at Kantipur City College, Kathmand

http://slidepdf.com/reader/full/advance-dbms-concept-presented-at-kantipur-city-college-kathmand 21/30

Speedup and Scaleup with Different Workloads

Workload Speedup Scaleup------------------------------------------OLTP No YesDSS Yes YesParallel Query Yes YesBatch (Mixed) Possible Yes

8/6/2019 Advance DBMS Concept Presented at Kantipur City College, Kathmand

http://slidepdf.com/reader/full/advance-dbms-concept-presented-at-kantipur-city-college-kathmand 22/30

Benefits of Parallel Databases

� Parallel database technology canbenefit certain kinds of applicationsby enabling:o Higher Performance With more CPUs

available to an application, higherspeedup and scaleup can be attained

o High Availability Nodes are isolated

from each other, so a failure at onenode does not bring the entire systemdown

8/6/2019 Advance DBMS Concept Presented at Kantipur City College, Kathmand

http://slidepdf.com/reader/full/advance-dbms-concept-presented-at-kantipur-city-college-kathmand 23/30

Multi-Instance Database System

8/6/2019 Advance DBMS Concept Presented at Kantipur City College, Kathmand

http://slidepdf.com/reader/full/advance-dbms-concept-presented-at-kantipur-city-college-kathmand 24/30

Distributed Database System

8/6/2019 Advance DBMS Concept Presented at Kantipur City College, Kathmand

http://slidepdf.com/reader/full/advance-dbms-concept-presented-at-kantipur-city-college-kathmand 25/30

Parallel Execution

� With parallel execution features, DBMScan divide the work of processing SQLstatements among multiple query server

processes� Provides the framework for parallel

execution to work between nodes� The data server must parallelize

individual queries into units of work thatcan be processed simultaneously inmultiprocessing systems

8/6/2019 Advance DBMS Concept Presented at Kantipur City College, Kathmand

http://slidepdf.com/reader/full/advance-dbms-concept-presented-at-kantipur-city-college-kathmand 26/30

Example of Parallel ExecutionProcessing

8/6/2019 Advance DBMS Concept Presented at Kantipur City College, Kathmand

http://slidepdf.com/reader/full/advance-dbms-concept-presented-at-kantipur-city-college-kathmand 27/30

8/6/2019 Advance DBMS Concept Presented at Kantipur City College, Kathmand

http://slidepdf.com/reader/full/advance-dbms-concept-presented-at-kantipur-city-college-kathmand 28/30

Usage of Multi-Dimensional Data

� Question:- How many 3kg laundry packsof powder did we sell in Eastern Region inthe last three months?o Involve several dimensions of information and

can be answered straightforward if a multi-dimensional view of the data is available

o Complicated, because individual dimensionsoften have an inherent hierarchy of variableswithin them

8/6/2019 Advance DBMS Concept Presented at Kantipur City College, Kathmand

http://slidepdf.com/reader/full/advance-dbms-concept-presented-at-kantipur-city-college-kathmand 29/30

Online Analytical-Processing (OL AP)

� Fast Analysis of Shared MultidimensionalInformationo FAST: most responses to users within about 5

seconds simplest analyses taking no more than 1

second very few taking more than 20 secondso ANALYSIS: any business logic and statistical

analysis easy enough for the target usero SHAR ED all the security requirements for

confidentialityo MULTIDIMENSIONAL: multidimensional conceptual

view of the data, including full support forhierarchies

o INFOR MATION: all of the data and derived info.needed

8/6/2019 Advance DBMS Concept Presented at Kantipur City College, Kathmand

http://slidepdf.com/reader/full/advance-dbms-concept-presented-at-kantipur-city-college-kathmand 30/30

OL AP Vs OLTP (Online TransactionProcessing