Transcript 슬라이드 1 - Pusan
File Processing : Storage Media
2015, Spring Pusan National University Ki-Joune Li
PNU
Major Functions of Computer
Computation Storage Communication Presentation STEM
PNU
Storage of Data
Major Challenges
How to store and manage a large amount of data
Example : more than 100 peta bytes for EOS Project
How to represent sophisticated data STEM
PNU
Modeling and Representation of Real World
Example
Building DB about Korean History Real World Computer World STEM
Very complicated and Depending on viewpoint Database Course : 2010 Fall semester
PNU
Managing Large Volume of Data
Large Volume of Data
Cost for Storage Media
Not very important and negligible
Processing Time
Comparison between main memory and disk access time
RAM : several nanoseconds (10 -9 sec) Disk : several milliseconds (10 -3 sec)
Time is the most valuable resource
Example
Retrieving a piece of data from 100 peta bytes DB STEM
PNU
Managing Large Volume of Data
Management of Data
Secure Management
From hacking
From any kinds of disasters
Consistency of Data
Example
Failure during a flight reservation transaction
Concurrent transaction STEM
PNU
Goals of File Systems
STEM
To provide with 1. efficient Data Structures for storing large and complex data 2. Access Methods for rapid search 3. Query Processing Methods 4. Robust Management of Transactions
PNU
Memory Hierarchy
STEM
Large Data Volume
Not be stored in main memory
But in secondary memory Memory Hierarchy Cache Memory Main Memory Secondary Memory Tertiary Memory 256 K bytes 1G bytes 100 G bytes 100 Tera bytes
Faster Cheaper
PNU
Flash Memory
STEM
Non-Volatile
Data survives power failure, but Data can be written at a location only once, but location can be erased and written to again
Can support only a limited number of write/erase cycles.
Erasing of memory has to be done to an entire bank of memory Speed
Reads are roughly as fast as main memory But writes are slow (few microseconds), erase is slower Cost per unit of storage roughly similar to main memory Widely used in embedded devices such as digital cameras
PNU
Optical Storage
Non-volatile :
data is read optically from a spinning disk using a laser
CD-ROM (800 MB), DVD (4.7 to 17 GB), CD-R, DVD-R
CD-RW, DVD-RW, and DVD-RAM Speed
Reads and writes are slower than with magnetic disk Juke-box systems
Large numbers of removable disks,
Few drives, and
Mechanism for automatic loading/unloading of disks
For storing large volumes of data STEM
PNU
Tape
Non-volatile
Primarily Used for backup Speed
Sequential access : much slower than disk Cost
Very high capacity (40 to 300 GB tapes available)
Tape can be removed from drive
Drives are expensive Tape jukeboxes
hundreds of terabytes to even a petabyte STEM
PNU
Data Access with Secondary Memory
STEM
Get Data Access Request
Hit Ratio r
h
= n
h
/ n
a
How to increase hit ratio ?
Get Data
If in main memory
Main Memory
Load on main memory
If not in main memory
Access to Disk
Disk
PNU
Why Hit Ratio is so important ?
Example for(int i=0;i<1000;i++) Nbytes=read(fd,buf,100); when r
h
= 0
1000 * 10 -2 sec = 10 sec
STEM
1000 disk accesses ?
when r
h
= 1
1000 * 10 -8 sec = 10 -5 sec
PNU
Physical Structure of Disk
200~400 sectors 512 bytes 2 * n
DF
STEM
PNU
Disk Access Time
STEM
Disk Access Time t = t
S
+ t
R
+ t
T
, where
t S
: Seek Time Time to reposition the head over the correct track
Average seek time is 1/2 the worst case seek time
4 to 10 milliseconds on typical disks
t R
: Rotational Latency
Time to reposition the head over the correct sector Average rotational latency : ½ r (to find index point) + ½ r =
r
In case of 15000 rpm : r =1*60sec/15000 = 4 msec
t T
: Transfer Time
Time to transfer data from disk to main memory via channel
Proportional to the number of sectors to read Real transfer time is negligible
PNU
Block-Oriented Disk Access
Example for(int i=0;i<1000;i++) Nbytes=read(fd,buf,10); 1000 times 100 times
Buffer in main memory
10 times
Number of Disk Accesses
1 block (e.g. 1024 bytes) STEM
10 bytes 1024 bytes
PNU
Disk Block
Unit of Disk Access Block Size
Normally multiple of sectors
1K, 4K, 16K or 64K bytes depending on configuration Why not large block ?
Limited by the size of available main memory
Too large : unnecessary accesses of sectors
e.g. only 100 bytes, when block size is given as 64K
1 block : 128 sectors (about ½ track, ½ rotation, 2 msec)
Too wasteful STEM