Chapter 8 External Storage. Primary vs. Secondary Storage Primary storage: Main memory (RAM) Secondary Storage: Peripheral devices  Disk drives  Tape.

Slides:



Advertisements
Similar presentations
Storing Data: Disk Organization and I/O
Advertisements

Secondary Storage Devices: Magnetic Disks
Csci 2111: Data and File Structures Week2, Lecture 1 & 2
I/O Management and Disk Scheduling
Peripheral Storage Devices
Lecture # 7. Topics Storage Techniques of Bits Storage Techniques of Bits Mass Storage Mass Storage Disk System Performance Disk System Performance File.
Storing Data: Disks and Files: Chapter 9
Problems in IO & File System CS 1550 Recitation November 4 th /6 th, 2002 The questions in this slide are from Andrew S. Tanenbaum's textbook page 375,
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.
1 Storing Data: Disks and Files Yanlei Diao UMass Amherst Feb 15, 2007 Slides Courtesy of R. Ramakrishnan and J. Gehrke.
1 Storage Hierarchy Cache Main Memory Virtual Memory File System Tertiary Storage Programs DBMS Capacity & Cost Secondary Storage.
1 CS143: Disks and Files. 2 System Architecture CPU Main Memory Disk Controller... Disk Word (1B – 64B) ~ x GB/sec Block (512B – 50KB) ~ x MB/sec System.
CS4432: Database Systems II Lecture 2 Timothy Sutherland.
CPSC-608 Database Systems Fall 2009 Instructor: Jianer Chen Office: HRBB 309B Phone: Notes #5.
Disks.
12/3/2004EE 42 fall 2004 lecture 391 Lecture #39: Magnetic memory storage Last lecture: –Dynamic Ram –E 2 memory This lecture: –Future memory technologies.
1 CS222: Principles of Database Management Fall 2010 Professor Chen Li Department of Computer Science University of California, Irvine Notes 01.
CENG 351 Fall Secondary Storage Devices: Magnetic Disks.
CPSC 231 Secondary storage (D.H.)1 Learning Objectives Understanding disk organization. Sectors, clusters and extents. Fragmentation. Disk access time.
Secondary Storage Management Hank Levy. 8/7/20152 Secondary Storage • Secondary Storage is usually: –anything outside of “primary memory” –storage that.
1 Secondary Storage Devices. 2 Content ►Secondary storage devices ►Organization of disks ►Organizing tracks by sector ►Organizing tracks by blocks ►Non-data.
1 Introduction to Computers Day 4. 2 Storage device A functional unit into which data can be –placed –retained(stored) –retrieved(accessed)
Computer SCIENCE Data Representation and Machine Concepts Section 1.3
Introduction to Database Systems 1 The Storage Hierarchy and Magnetic Disks Storage Technology: Topic 1.
Chapter 8 File Processing and External Sorting. Primary vs. Secondary Storage Primary storage: Main memory (RAM) Secondary Storage: Peripheral devices.
CS4432: Database Systems II Data Storage (Better Block Organization) 1.
DISKS IS421. DISK  A disk consists of Read/write head, and arm  A platter is divided into Tracks and sector  The R/W heads can R/W at the same time.
CS 346 – Chapter 10 Mass storage –Advantages? –Disk features –Disk scheduling –Disk formatting –Managing swap space –RAID.
Lecture 11: DMBS Internals
1 6 Further System Fundamentals (HL) 6.2 Magnetic Disk Storage.
Introduction to Database Systems 1 Storing Data: Disks and Files Chapter 3 “Yea, from the table of my memory I’ll wipe away all trivial fond records.”
CS 111 – Aug – 1.3 –Information arranged in memory –Types of memory –Disk properties Commitment for next day: –Read pp , In other.
1Fall 2008, Chapter 12 Disk Hardware Arm can move in and out Read / write head can access a ring of data as the disk rotates Disk consists of one or more.
Database Management Systems,Shri Prasad Sawant. 1 Storing Data: Disks and Files Unit 1 Mr.Prasad Sawant.
External Storage Primary Storage : Main Memory (RAM). Secondary Storage: Peripheral Devices –Disk Drives –Tape Drives Secondary storage is CHEAP. Secondary.
Describing Storage Devices  Storage terms  Media is the material storing data  Storage devices manage the media  Magnetic devices use a magnet  Optical.
Secondary Storage Devices: Magnetic Disks Optical Disks Floppy Disks Magnetic Tapes CENG 351.
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.
Indexing CS 400/600 – Data Structures. Indexing2 Memory and Disk  Typical memory access: 30 – 60 ns  Typical disk access: 3-9 ms  Difference: 100,000.
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?
Storing Data Dina Said 1 1.
Disk Basics CS Introduction to Operating Systems.
CS 101 – Sept. 28 Main vs. secondary memory Examples of secondary storage –Disk (direct access) Various types Disk geometry –Flash memory (random access)
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.
Disk storage systems Question#1 (True/False) A track is divided into multiple units called sectors.
Disk Average Seek Time. Multi-platter Disk platter Disk read/write arm read/write head.
Magnetic Disk Rotational latency Example Find the average rotational latency if the disk rotates at 20,000 rpm.
CPSC 231 Secondary storage (D.H.)1 Learning Objectives Understanding disk organization. Sectors, clusters and extents. Fragmentation. Disk access time.
Programmer’s View of Files Logical view of files: –An a array of bytes. –A file pointer marks the current position. Three fundamental operations: –Read.
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.
Lecture 3 Secondary Storage and System Software I
1 Components of the Virtual Memory System  Arrows indicate what happens on a lw virtual address data physical address TLB page table memory cache disk.
CS422 Principles of Database Systems Disk Access Chengyu Sun California State University, Los Angeles.
File organization Secondary Storage Devices Lec#7 Presenter: Dr Emad Nabil.
File Structures How are the database tables stored on disk?
Database Applications (15-415) DBMS Internals- Part I Lecture 11, February 16, 2016 Mohammad Hammoud.
Secondary Storage Devices
Lecture 16: Data Storage Wednesday, November 6, 2006.
Database Management Systems (CS 564)
Backing Store.
Part V Memory System Design
Disks and Files DBMS stores information on (“hard”) disks.
Lecture 11: DMBS Internals
Secondary Storage Management Hank Levy
Chapter 11: Mass-Storage Systems
Presentation transcript:

Chapter 8 External Storage

Primary vs. Secondary Storage Primary storage: Main memory (RAM) Secondary Storage: Peripheral devices  Disk drives  Tape drives

Comparisons RAM is usually volatile. RAM is about 1/4 million times faster than disk. MediumEarly 1996 Mid 1997Early 2000 RAM$ Disk Floppy Tape

Golden Rule of File Processing Minimize the number of disk accesses! 1. Arrange information so that you get what you want with few disk accesses. 2. Arrange information to minimize future disk accesses. An organization for data on disk is often called a file structure. Disk-based space/time tradeoff: Compress information to save processing time by reducing disk accesses.

Disk Drives

Sectors A sector is the basic unit of I/O. Interleaving factor: Physical distance between logically adjacent sectors on a track.

Terms Locality of Reference: When record is read from disk, next request is likely to come from near the same place in the file. Cluster: Smallest unit of file allocation, usually several sectors. Extent: A group of physically contiguous clusters. Internal fragmentation: Wasted space within sector if record size does not match sector size; wasted space within cluster if file size is not a multiple of cluster size.

Seek Time Seek time: Time for I/O head to reach desired track. Largely determined by distance between I/O head and desired track. Track-to-track time: Minimum time to move from one track to an adjacent track. Average Seek time: Average time to reach a track for random access.

Other Factors Rotational Delay or Latency: Time for data to rotate under I/O head.  One half of a rotation on average.  At 7200 rpm, this is 8.3/2 = 4.2ms. Transfer time: Time for data to move under the I/O head.  At 7200 rpm: Number of sectors read/Number of sectors per track * 8.3ms.

Disk Spec Example 16.8 GB disk on 10 platters = 1.68GB/platter 13,085 tracks/platter 256 sectors/track 512 bytes/sector Track-to-track seek time: 2.2 ms Average seek time: 9.5ms 4KB clusters, 32 clusters/track. Interleaving factor of RPM

Disk Access Cost Example (1) Read a 1MB file divided into 2048 records of 512 bytes (1 sector) each. Assume all records are on 8 contiguous tracks. First track: /2 + 3 x 11.1 = 48.4 ms Remaining 7 tracks: /2 + 3 x 11.1 = 41.1 ms. Total: * 41.1 = 335.7ms

Disk Access Cost Example (2) Read a 1MB file divided into 2048 records of 512 bytes (1 sector) each. Assume all file clusters are randomly spread across the disk. 256 clusters. Cluster read time is (3 x 8)/256 of a rotation for about 1 ms. 256( /2 + (3 x 8)/256) is about 3877 ms. or nearly 4 seconds.

How Much to Read? Read time for one track: /2 + 3 x 11.1 = 48.4ms. Read time for one sector: /2 + (1/256)11.1 = 15.1ms. Read time for one byte: /2 = ms. Nearly all disk drives read/write one sector at every I/O access.  Also referred to as a page.