CS 277 – Spring 2002Notes 21 CS 277: Database System Implementation Notes 02: Hardware Arthur Keller.

Slides:



Advertisements
Similar presentations
CPS216: Data-Intensive Computing Systems Data Access from Disks Shivnath Babu.
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?
CS 245Notes 21 CS 245: Database System Principles Notes 02: Hardware Hector Garcia-Molina.
Data Storage John Ortiz. Lecture 17Data Storage2 Overview  Database stores data on secondary storage  Disk has distinct storage and access characteristics.
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 Advanced Database Technology February 12, 2004 DATA STORAGE (Lecture based on [GUW ], [Sanders03, ], and [MaheshwariZeh03, ])
CPSC-608 Database Systems Fall 2008 Instructor: Jianer Chen Office: HRBB 309B Phone: Notes #6.
Disk Drivers May 10, 2000 Instructor: Gary Kimura.
CS 4432lecture #31 CS4432: Database Systems II Lecture #3 Professor Elke A. Rundensteiner.
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.
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.
CPSC-608 Database Systems Fall 2010 Instructor: Jianer Chen Office: HRBB 315C Phone: Notes #5.
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.
Secondary Storage CSCI 444/544 Operating Systems Fall 2008.
CS 4432lecture #31 CS4432: Database Systems II Lecture #3 Using the Disk, and Disk Optimizations Professor Elke A. Rundensteiner.
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.
Secondary Storage Management Hank Levy. 8/7/20152 Secondary Storage • Secondary Storage is usually: –anything outside of “primary memory” –storage that.
1 Introduction to Computers Day 4. 2 Storage device A functional unit into which data can be –placed –retained(stored) –retrieved(accessed)
Introduction to Database Systems 1 The Storage Hierarchy and Magnetic Disks Storage Technology: Topic 1.
ICOM 6005 – Database Management Systems Design Dr. Manuel Rodríguez-Martínez Electrical and Computer Engineering Department Lecture 5 – Storage Organization.
CS4432: Database Systems II Data Storage (Better Block Organization) 1.
Chapter 2 Data Storage How does a computer system store and manage very large volumes of data ?
CMPT 454, Simon Fraser University, Fall 2009, Martin Ester 29 Database Systems II Secondary Storage.
IT 344: Operating Systems Winter 2010 Module 13 Secondary Storage Chia-Chi Teng CTB 265.
Chapter 111 Chapter 11: Hardware (Slides by Hector Garcia-Molina,
Disks Chapter 5 Thursday, April 5, Today’s Schedule Input/Output – Disks (Chapter 5.4)  Magnetic vs. Optical Disks  RAID levels and functions.
1 Data Storage (Chap. 11) Based on Hector Garcia-Molina’s slides.
Programming for GCSE Topic 5.1: Memory and Storage T eaching L ondon C omputing William Marsh School of Electronic Engineering and Computer Science Queen.
11.1Database System Concepts. 11.2Database System Concepts Now Something Different 1st part of the course: Application Oriented 2nd part of the course:
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?
CPSC-608 Database Systems Fall 2015 Instructor: Jianer Chen Office: HRBB 315C Phone: Notes #5.
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)
Section 13.2 – Secondary storage management (Former Student’s Note)
DBMS 2001Notes 2: Hardware1 Principles of Database Management Systems Pekka Kilpeläinen (after Stanford CS245 slide originals by Hector Garcia-Molina,
DMBS Internals I. What Should a DBMS Do? Store large amounts of data Process queries efficiently Allow multiple users to access the database concurrently.
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.
1 CSE232A: Database System Principles Hardware. Data + Indexes Database System Architecture Query ProcessingTransaction Management SQL query Parser Query.
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.
CPS216: Advanced Database Systems Notes 03: Data Access from Disks Shivnath Babu.
1 Lecture 16: Data Storage Wednesday, November 6, 2006.
CS 245Notes 21 Database System Principles Notes 02: Hardware.
1 Query Processing Exercise Session 1. 2 The system (OS or DBMS) manages the buffer Disk B1B2B3 Bn … … Program’s private memory An application program.
File organization Secondary Storage Devices Lec#7 Presenter: Dr Emad Nabil.
Chapter 10: Mass-Storage Systems
Computer Science 210 Computer Organization
CS 554: Advanced Database System Notes 02: Hardware
CPSC-608 Database Systems
Sanuja Dabade & Eilbroun Benjamin CS 257 – Dr. TY Lin
CSE 451: Operating Systems Winter 2006 Module 13 Secondary Storage
CSE 451: Operating Systems Autumn 2003 Lecture 12 Secondary Storage
Disks and scheduling algorithms
Persistence: hard disk drive
CSE 451: Operating Systems Secondary Storage
CSE 451: Operating Systems Winter 2003 Lecture 12 Secondary Storage
CSE 451: Operating Systems Spring 2005 Module 13 Secondary Storage
CSE 451: Operating Systems Autumn 2004 Secondary Storage
CSE 451: Operating Systems Winter 2004 Module 13 Secondary Storage
CPS216: Advanced Database Systems Notes 04: Data Access from Disks
CS 245: Database System Principles Notes 02: Hardware
Introduction to Operating Systems
Presentation transcript:

CS 277 – Spring 2002Notes 21 CS 277: Database System Implementation Notes 02: Hardware Arthur Keller

CS 277 – Spring 2002Notes 22 Outline Hardware: Disks Access Times Example - Megatron 747 Optimizations Other Topics: –Storage costs –Using secondary storage –Disk failures

CS 277 – Spring 2002Notes 23 Hardware DBMS Data Storage

CS 277 – Spring 2002Notes 24 P MC Typical Computer Secondary Storage...

CS 277 – Spring 2002Notes 25 Processor Fast, slow, reduced instruction set, with cache, pipelined… Speed: 100  500  1000 MIPS Memory Fast, slow, non-volatile, read-only,… Access time:  sec. 1  s  1 ns

CS 277 – Spring 2002Notes 26 Secondary storage Many flavors: - Disk: Floppy (hard, soft) Removable Packs Winchester Ram disks Optical, CD-ROM… Arrays - TapeReel, cartridge Robots

CS 277 – Spring 2002Notes 27 Focus on: “Typical Disk” Terms: Platter, Head, Actuator Cylinder, Track Sector (physical), Block (logical), Gap …

CS 277 – Spring 2002Notes 28 Top View

CS 277 – Spring 2002Notes 29 “Typical” Numbers Diameter: 1 inch  15 inches Cylinders:100  2000 Surfaces:1 (CDs)  (Tracks/cyl) 2 (floppies)  30 Sector Size:512B  50K Capacity:360 KB (old floppy)  70 GB (I use)

CS 277 – Spring 2002Notes 210 Disk Access Time block x in memory ? I want block X

CS 277 – Spring 2002Notes 211 Time = Seek Time + Rotational Delay + Transfer Time + Other

CS 277 – Spring 2002Notes 212 Seek Time 3 or 5x x 1N Cylinders Traveled Time

CS 277 – Spring 2002Notes 213 Average Random Seek Time   SEEKTIME (i  j) S = N(N-1) N N i=1 j=1 j  i “Typical” S: 10 ms  40 ms

CS 277 – Spring 2002Notes 214 Rotational Delay Head Here Block I Want

CS 277 – Spring 2002Notes 215 Average Rotational Delay R = 1/2 revolution “typical” R = 8.33 ms (3600 RPM) Faster disks now 7200 RPM (R = 4.17 ms) Fastest disks now 10,000 RPM (R = 3 ms)

CS 277 – Spring 2002Notes 216 Complication May have to wait for start of track before we an read desired block Head Here Block We Want Track Start

CS 277 – Spring 2002Notes 217 Transfer Rate: t “typical” t: 1  3 MB/second transfer time: block size t

CS 277 – Spring 2002Notes 218 Other Delays CPU time to issue I/O Contention for controller Contention for bus, memory “Typical” Value: 0

CS 277 – Spring 2002Notes 219 So far: Random Block Access What about: Reading “Next” block?

CS 277 – Spring 2002Notes 220 If we do things right (e.g., Double Buffer, Stagger Blocks,…) Time to get = Block Size + Negligible block t - skip gap - switch track - once in a while, next cylinder

CS 277 – Spring 2002Notes 221 Rule ofRandom I/O: Expensive Thumb Sequential I/O: Much less Ex:1 KB Block »Random I/O:  20 ms. »Sequential I/O:  1 ms.

CS 277 – Spring 2002Notes 222 Cost for Writing similar to Reading …. unless we want to verify! need to add (full) rotation + Block size t

CS 277 – Spring 2002Notes 223 To Modify a Block? To Modify Block: (a) Read Block (b) Modify in Memory (c) Write Block [(d) Verify?]

CS 277 – Spring 2002Notes 224 Block Address: Physical Device Cylinder # Surface # Sector

CS 277 – Spring 2002Notes 225 Complication: Bad Blocks Messy to handle May map via software to integer sequence 1 2.Map Actual Block Addresses. m

CS 277 – Spring 2002Notes in diameter 3600 RPM 1 surface 16 MB usable capacity (16 X 2 20 ) 128 cylinders seek time: average = 25 ms. adjacent cyl = 5 ms. An Example Megatron 747 Disk (old)

CS 277 – Spring 2002Notes KB blocks = sectors 10% overhead between blocks capacity = 16 MB = (2 20 )16 = 2 24 # cylinders = 128 = 2 7 bytes/cyl = 2 24 /2 7 = 2 17 = 128 KB blocks/cyl = 128 KB / 1 KB = 128

CS 277 – Spring 2002Notes RPM 60 revolutions / sec 1 rev. = msec. One track:... Time over useful data:(16.66)(0.9)=14.99 ms. Time over gaps: (16.66)(0.1) = 1.66 ms. Transfer time 1 block = 14.99/128=0.117 ms. Trans. time 1 block+gap=16.66/128=0.13ms.

CS 277 – Spring 2002Notes 229 Burst Bandwidth 1 KB in ms. BB = 1/0.117 = 8.54 KB/ms. or BB =8.54KB/ms x 1000 ms/1sec x 1MB/1024KB = 8540/1024 = 8.33 MB/sec

CS 277 – Spring 2002Notes 230 Sustained bandwidth (over track) 128 KB in ms. SB = 128/16.66 = 7.68 KB/ms or SB = 7.68 x 1000/1024 = 7.50 MB/sec.

CS 277 – Spring 2002Notes 231 T 1 = Time to read one random block T 1 = seek + rotational delay + TT = 25 + (16.66/2) = ms. assuming we do not have to wait for track start

CS 277 – Spring 2002Notes 232 Suppose OS deals with 4 KB blocks T 4 = 25 + (16.66/2) + (.117) x 1 + (.130) X 3 = ms [Compare to T 1 = ms] block

CS 277 – Spring 2002Notes 233 T T = Time to read a full track (start at any block) T T = 25 + (0.130/2) * = ms to get to first block * Actually, a bit less; do not have to read last gap.

CS 277 – Spring 2002Notes 234 The NEW Megatron 747 (Example 11.1 book) 8 Surfaces, 3.5 Inch diameter – outer 1 inch used 2 13 = 8192 Tracks/surface 256 Sectors/track 2 9 = 512 Bytes/sector

CS 277 – Spring 2002Notes GB Disk If all tracks have 256 sectors Outermost density: 100,000 bits/inch Inner density: 250,000 bits/inch 1.

CS 277 – Spring 2002Notes 236 Outer third of tracks: 320 sectors Middle third of tracks: 256 Inner third of tracks: 192 Density: 114,000  182,000 bits/inch

CS 277 – Spring 2002Notes 237 Timing for new Megatron 747 (Ex 11.3) Time to read 4096-byte block: –MIN: 0.5 ms –MAX: 33.5 ms –AVE: 14.8 ms

CS 277 – Spring 2002Notes 238 Outline Hardware: Disks Access Times Example: Megatron 747 Optimizations Other Topics –Storage Costs –Using Secondary Storage –Disk Failures here

CS 277 – Spring 2002Notes 239 Optimizations (in controller or O.S.) Disk Scheduling Algorithms –e.g., elevator algorithm Track (or larger) Buffer Pre-fetch Arrays Mirrored Disks

CS 277 – Spring 2002Notes 240 Double Buffering Problem: Have a File » Sequence of Blocks B1, B2 Have a Program » Process B1 » Process B2 » Process B3...

CS 277 – Spring 2002Notes 241 Single Buffer Solution (1) Read B1  Buffer (2) Process Data in Buffer (3) Read B2  Buffer (4) Process Data in Buffer...

CS 277 – Spring 2002Notes 242 SayP = time to process/block R = time to read in 1 block n = # blocks Single buffer time = n(P+R)

CS 277 – Spring 2002Notes 243 Double Buffering Memory: Disk: ABCDGEFA B done process A C B done

CS 277 – Spring 2002Notes 244 Say P  R What is processing time? P = Processing time/block R = IO time/block n = # blocks Double buffering time = R + nP Single buffering time = n(R+P)

CS 277 – Spring 2002Notes 245 Block Size Selection? Big Block  Amortize I/O Cost Big Block  Read in more useless stuff! and takes longer to read Unfortunately...

CS 277 – Spring 2002Notes 246 Trend As memory prices drop, blocks get bigger... Trend

CS 277 – Spring 2002Notes 247 Storage Cost access time (sec) cache electronic main electronic secondary magnetic optical disks online tape nearline tape & optical disks offline tape typical capacity (bytes) from Gray & Reuter

CS 277 – Spring 2002Notes 248 Storage Cost access time (sec) cache electronic main electronic secondary magnetic optical disks online tape nearline tape & optical disks offline tape dollars/MB from Gray & Reuter

CS 277 – Spring 2002Notes 249 Using secondary storage effectively (Sec. 11.3) Example: Sorting data on disk Conclusion: –I/O costs dominate –Design algorithms to reduce I/O Also: How big should blocks be?

CS 277 – Spring 2002Notes 250 Disk Failures (Sec 11.5) Partial  Total Intermittent  Permanent

CS 277 – Spring 2002Notes 251 Coping with Disk Failures Detection –e.g., Checksum Correction  Redundancy

CS 277 – Spring 2002Notes 252 At what level do we cope? Single Disk –e.g., Error Correcting Codes Disk Array Logical Physical

CS 277 – Spring 2002Notes 253 Operating System e.g., Stable Storage Logical BlockCopy A Copy B

CS 277 – Spring 2002Notes 254 Database System e.g., Log Current DBLast week’s DB

CS 277 – Spring 2002Notes 255 Summary Secondary storage, mainly disks I/O times I/Os should be avoided, especially random ones….. Summary

CS 277 – Spring 2002Notes 256 Outline Hardware: Disks Access Times Example: Megatron 747 Optimizations Other Topics –Storage Costs –Using Secondary Storage –Disk Failures here