Sanuja Dabade & Eilbroun Benjamin CS 257 – Dr. TY Lin

Slides:



Advertisements
Similar presentations
13.2 Disks Gaurav Sharma Class ID Mechanics of Disks 2 Moving Principal Moving pieces of Disk are: 1. Disk assembly & 2. Head Assembly The.
Advertisements

- Dr. Kalpakis CMSC Dr. Kalpakis 1 Outline In implementing DBMS we need to answer How should the system store and manage very large amounts of data?
Storing Data: Disks and Files: Chapter 9
The Memory Hierarchy fastest, perhaps 1Mb
Storage. The Memory Hierarchy fastest, but small under a microsecond, random access, perhaps 2Gb Typically magnetic disks, magneto­ optical (erasable),
CS4432: Database Systems II Data Storage - Lecture 2 (Sections 13.1 – 13.3) Elke A. Rundensteiner.
SECTION 13.3 Eilbroun Benjamin CS 257 – Dr. TY Lin SECONDARY STORAGE MANAGEMENT.
13.2 Disks Mechanics of Disks Presented by Chao-Hsin Shih Feb 21, 2011.
OS2-1 Chapter 2 Computer System Structures. OS2-2 Outlines Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection.
1 Storing Data: Disks and Files Yanlei Diao UMass Amherst Feb 15, 2007 Slides Courtesy of R. Ramakrishnan and J. Gehrke.
Disk Drivers May 10, 2000 Instructor: Gary Kimura.
1 Storage Hierarchy Cache Main Memory Virtual Memory File System Tertiary Storage Programs DBMS Capacity & Cost Secondary Storage.
SECTIONS 13.1 – 13.3 Sanuja Dabade & Eilbroun Benjamin CS 257 – Dr. TY Lin SECONDARY STORAGE MANAGEMENT.
CS4432: Database Systems II Lecture 2 Timothy Sutherland.
CPSC-608 Database Systems Fall 2009 Instructor: Jianer Chen Office: HRBB 309B Phone: Notes #5.
Disks.
1 CS222: Principles of Database Management Fall 2010 Professor Chen Li Department of Computer Science University of California, Irvine Notes 01.
SECTIONS 13.1 – 13.3 Sanuja Dabade & Eilbroun Benjamin CS 257 – Dr. TY Lin SECONDARY STORAGE MANAGEMENT.
CPSC 231 Secondary storage (D.H.)1 Learning Objectives Understanding disk organization. Sectors, clusters and extents. Fragmentation. Disk access time.
Introduction to Database Systems 1 The Storage Hierarchy and Magnetic Disks Storage Technology: Topic 1.
12.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 12: Mass-Storage Systems.
Chapter 2 Data Storage How does a computer system store and manage very large volumes of data ?
Lecture 11: DMBS Internals
1 Secondary Storage Management Submitted by: Sathya Anandan(ID:123)
CS 6502 Operating Systems Dr. J.. Garrido Device Management (Lecture 7b) CS5002 Operating Systems Dr. Jose M. Garrido.
External Storage Primary Storage : Main Memory (RAM). Secondary Storage: Peripheral Devices –Disk Drives –Tape Drives Secondary storage is CHEAP. Secondary.
Lecture 3 Page 1 CS 111 Online Disk Drives An especially important and complex form of I/O device Still the primary method of providing stable storage.
DMBS Internals I. What Should a DBMS Do? Store large amounts of data Process queries efficiently Allow multiple users to access the database concurrently.
CS4432: Database Systems II Data Storage 1. Storage in DBMSs DBMSs manage large amounts of data How does a DBMS store and manage large amounts of data?
By : Reem Hasayen. A storage device is a hardware device capable of storing information. There are two types of storage devices used in computers 1. Primary.
Operating Systems (CS 340 D) Princess Nora University Faculty of Computer & Information Systems Computer science Department.
Section 13.2 – Secondary storage management (Former Student’s Note)
Section 13.1 – Secondary storage management (Former Student’s Note)
DMBS Internals I February 24 th, What Should a DBMS Do? Store large amounts of data Process queries efficiently Allow multiple users to access the.
DMBS Internals I. What Should a DBMS Do? Store large amounts of data Process queries efficiently Allow multiple users to access the database concurrently.
Section 13.2 – Secondary storage management. Index 13.2 Disks Mechanics of Disks The Disk Controller Disk Access Characteristics.
CPSC 231 Secondary storage (D.H.)1 Learning Objectives Understanding disk organization. Sectors, clusters and extents. Fragmentation. Disk access time.
COSC 6340: Disks 1 Disks and Files DBMS stores information on (“hard”) disks. This has major implications for DBMS design! » READ: transfer data from disk.
1 Lecture 16: Data Storage Wednesday, November 6, 2006.
Data Storage and Querying in Various Storage Devices.
File organization Secondary Storage Devices Lec#7 Presenter: Dr Emad Nabil.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Lec 5 part1 Disk Storage, Basic File Structures, and Hashing.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Disks and Files.
File Organization Record Storage and Primary File Organization
Computer System Structures Storage
CS522 Advanced database Systems
Storage Overview of Physical Storage Media Magnetic Disks RAID
Section 13.2 – Secondary storage management (Former Student’s Note)
Database Applications (15-415) DBMS Internals- Part I Lecture 11, February 16, 2016 Mohammad Hammoud.
Chapter 2: Computer-System Structures
Storage and Disks.
Lecture 16: Data Storage Wednesday, November 6, 2006.
Database Management Systems (CS 564)
CS 554: Advanced Database System Notes 02: Hardware
I/O Resource Management: Software
CPSC-608 Database Systems
Oracle SQL*Loader
9/12/2018.
Disks and Files DBMS stores information on (“hard”) disks.
Lecture 11: DMBS Internals
Disk Storage, Basic File Structures, and Hashing
Disk Storage, Basic File Structures, and Buffer Management
Operating Systems (CS 340 D)
Disk storage Index structures for files
Secondary Storage Management Brian Bershad
Section 13.1 – Secondary storage management (Former Student’s Note)
13.3 Accelerating Access to Secondary Storage
Secondary Storage Management Hank Levy
CSE451 File System Introduction and Disk Drivers Autumn 2002
Chapter 11: Mass-Storage Systems
Presentation transcript:

Sanuja Dabade & Eilbroun Benjamin CS 257 – Dr. TY Lin Secondary storage management Sections 13.1 – 13.3 Sanuja Dabade & Eilbroun Benjamin CS 257 – Dr. TY Lin

Presentation Outline 13.1 The Memory Hierarchy 13.2 Disks 13.1.2 Transfer of Data Between Levels 13.1.3 Volatile and Nonvolatile Storage 13.1.4 Virtual Memory 13.2 Disks 13.2.1 Mechanics of Disks 13.2.2 The Disk Controller 13.2.3 Disk Access Characteristics Introductory notes.

Presentation Outline (con’t) 13.3 Accelerating Access to Secondary Storage 13.3.1 The I/O Model of Computation 13.3.2 Organizing Data by Cylinders 13.3.3 Using Multiple Disks 13.3.4 Mirroring Disks 13.3.5 Disk Scheduling and the Elevator Algorithm 13.3.6 Prefetching and Large-Scale Buffering Introductory notes.

13.1.1 Memory Hierarchy Several components for data storage having different data capacities available Cost per byte to store data also varies Device with smallest capacity offer the fastest speed with highest cost per bit

Memory Hierarchy Diagram Programs, DBMS Main Memory DBMS’s Tertiary Storage As Visual Memory Disk File System Main Memory Cache

13.1.1 Memory Hierarchy Cache Lowest level of the hierarchy Data items are copies of certain locations of main memory Sometimes, values in cache are changed and corresponding changes to main memory are delayed Machine looks for instructions as well as data for those instructions in the cache Holds limited amount of data

13.1.1 Memory Hierarchy (con’t) No need to update the data in main memory immediately in a single processor computer In multiple processors data is updated immediately to main memory….called as write through

Main Memory Everything happens in the computer i.e. instruction execution, data manipulation, as working on information that is resident in main memory Main memories are random access….one can obtain any byte in the same amount of time

Secondary storage Used to store data and programs when they are not being processed More permanent than main memory, as data and programs are retained when the power is turned off E.g. magnetic disks, hard disks

Tertiary Storage Holds data volumes in terabytes Used for databases much larger than what can be stored on disk

13.1.2 Transfer of Data Between levels Data moves between adjacent levels of the hierarchy At the secondary or tertiary levels accessing the desired data or finding the desired place to store the data takes a lot of time Disk is organized into bocks Entire blocks are moved to and from memory called a buffer

13.1.2 Transfer of Data Between level (cont’d) A key technique for speeding up database operations is to arrange the data so that when one piece of data block is needed it is likely that other data on the same block will be needed at the same time Same idea applies to other hierarchy levels

13.1.3 Volatile and Non Volatile Storage A volatile device forgets what data is stored on it after power off Non volatile holds data for longer period even when device is turned off All the secondary and tertiary devices are non volatile and main memory is volatile

13.1.4 Virtual Memory Typical software executes in virtual memory Address space is typically 32 bit or 232 bytes or 4GB Transfer between memory and disk is in terms of blocks

13.2.1 Mechanism of Disk Mechanisms of Disks Use of secondary storage is one of the important characteristic of DBMS Consists of 2 moving pieces of a disk 1. disk assembly 2. head assembly Disk assembly consists of 1 or more platters Platters rotate around a central spindle Bits are stored on upper and lower surfaces of platters

13.2.1 Mechanism of Disk Disk is organized into tracks The track that are at fixed radius from center form one cylinder Tracks are organized into sectors Tracks are the segments of circle separated by gap

13.2.2 Disk Controller One or more disks are controlled by disk controllers Disks controllers are capable of Controlling the mechanical actuator that moves the head assembly Selecting the sector from among all those in the cylinder at which heads are positioned Transferring bits between desired sector and main memory Possible buffering an entire track

13.2.3 Disk Access Characteristics Accessing (reading/writing) a block requires 3 steps Disk controller positions the head assembly at the cylinder containing the track on which the block is located. It is a ‘seek time’ The disk controller waits while the first sector of the block moves under the head. This is a ‘rotational latency’ All the sectors and the gaps between them pass the head, while disk controller reads or writes data in these sectors. This is a ‘transfer time’

13.3 Accelerating Access to Secondary Storage Several approaches for more-efficiently accessing data in secondary storage: Place blocks that are together in the same cylinder. Divide the data among multiple disks. Mirror disks. Use disk-scheduling algorithms. Prefetch blocks into main memory. Scheduling Latency – added delay in accessing data caused by a disk scheduling algorithm. Throughput – the number of disk accesses per second that the system can accommodate. Objectives for instruction and expected results and/or skills developed from learning.

13.3.1 The I/O Model of Computation The number of block accesses (Disk I/O’s) is a good time approximation for the algorithm. This should be minimized. Ex 13.3: You want to have an index on R to identify the block on which the desired tuple appears, but not where on the block it resides. For Megatron 747 (M747) example, it takes 11ms to read a 16k block. A standard microprocessor can execute millions of instruction in 11ms, making any delay in searching for the desired tuple negligible. Objectives for instruction and expected results and/or skills developed from learning.

13.3.2 Organizing Data by Cylinders If we read all blocks on a single track or cylinder consecutively, then we can neglect all but first seek time and first rotational latency. Ex 13.4: We request 1024 blocks of M747. If data is randomly distributed, average latency is 10.76ms by Ex 13.2, making total latency 11s. If all blocks are consecutively stored on 1 cylinder: 6.46ms + 8.33ms * 16 = 139ms (1 average seek) (time per rotation) (# rotations) Objectives for instruction and expected results and/or skills developed from learning.

13.3.3 Using Multiple Disks If we have n disks, read/write performance will increase by a factor of n. Striping – distributing a relation across multiple disks following this pattern: Data on disk R1: R1, R1+n, R1+2n,… Data on disk R2: R2, R2+n, R2+2n,… … Data on disk Rn: Rn, Rn+n, Rn+2n, … Ex 13.5: We request 1024 blocks with n = 4. 6.46ms + (8.33ms * (16/4)) = 39.8ms (1 average seek) (time per rotation) (# rotations) Objectives for instruction and expected results and/or skills developed from learning.

13.3.4 Mirroring Disks Mirroring Disks – having 2 or more disks hold identical copied of data. Benefit 1: If n disks are mirrors of each other, the system can survive a crash by n-1 disks. Benefit 2: If we have n disks, read performance increases by a factor of n. Performance increases further by having the controller select the disk which has its head closest to desired data block for each read. Objectives for instruction and expected results and/or skills developed from learning.

13.3.5 Disk Scheduling and the Elevator Problem Disk controller will run this algorithm to select which of several requests to process first. Pseudo code: requests[] // array of all non-processed data requests upon receiving new data request: requests[].add(new request) while(requests[] is not empty) move head to next location if(head location is at data in requests[]) retrieve data remove data from requests[] if(head reaches end) reverse head direction Objectives for instruction and expected results and/or skills developed from learning.

13.3.5 Disk Scheduling and the Elevator Problem (con’t) Events: Head starting point Request data at 8000 Request data at 24000 Request data at 56000 Get data at 8000 Request data at 16000 Get data at 24000 Request data at 64000 Get data at 56000 Request Data at 40000 Get data at 64000 Get data at 40000 Get data at 16000 64000 56000 48000 Current time 30 Current time 34.2 Current time 45.5 Current time 56.8 Current time 26.9 Current time 20 Current time Current time 4.3 Current time Current time 10 Current time 13.6 40000 32000 24000 16000 8000 data time 8000.. 4.3 24000.. 13.6 56000.. 26.9 64000.. 34.2 40000.. 45.5 data time 8000.. 4.3 24000.. 13.6 56000.. 26.9 64000.. 34.2 40000.. 45.5 16000.. 56.8 data time 8000.. 4.3 24000.. 13.6 56000.. 26.9 64000.. 34.2 data time 8000.. 4.3 24000.. 13.6 56000.. 26.9 data time 8000.. 4.3 data time 8000.. 4.3 24000.. 13.6 data time Objectives for instruction and expected results and/or skills developed from learning.

13.3.5 Disk Scheduling and the Elevator Problem (con’t) Elevator Algorithm FIFO Algorithm data time 8000.. 4.3 24000.. 13.6 56000.. 26.9 64000.. 34.2 40000.. 45.5 16000.. 56.8 data time 8000.. 4.3 24000.. 13.6 56000.. 26.9 16000.. 42.2 64000.. 59.5 40000.. 70.8 Objectives for instruction and expected results and/or skills developed from learning.

13.3.6 Prefetching and Large-Scale Buffering If at the application level, we can predict the order blocks will be requested, we can load them into main memory before they are needed. Objectives for instruction and expected results and/or skills developed from learning.

Questions An opportunity for questions and discussions.