comp 335 – file structures why file structures?. goal of the class to develop an understanding of...

16
Comp 335 – File Structures Why File Structures?

Upload: charles-hoover

Post on 12-Jan-2016

213 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Comp 335 – File Structures Why File Structures?. Goal of the Class To develop an understanding of the file I/O process. Software must be able to interact

Comp 335 – File Structures

Why File Structures?

Page 2: Comp 335 – File Structures Why File Structures?. Goal of the Class To develop an understanding of the file I/O process. Software must be able to interact

Goal of the Class

To develop an understanding of the file I/O process. Software must be able to interact with files on secondary storage devices.

Learn primary methods of how files can be structured and organized to aid in efficient information storage and retrieval of the information QUICKLY and EFFICIENTLY!

Page 3: Comp 335 – File Structures Why File Structures?. Goal of the Class To develop an understanding of the file I/O process. Software must be able to interact

History of File Structures

Early in computing history, secondary storage was in the form of magnetic tape and punched cards. Storage was cheap but access was limited to sequential.

In 1956, IBM introduced the RAMAC magnetic disk device. It could be leased for $620 month and could store approximately 5 Mb of data. Data could be accessed directly instead of sequentially. Conserving the space on the disk and getting to the data quickly became an area of research. This was the dawn of the study of file structures. RAMAC Video

Page 4: Comp 335 – File Structures Why File Structures?. Goal of the Class To develop an understanding of the file I/O process. Software must be able to interact

IBM 350 Disk File

Page 5: Comp 335 – File Structures Why File Structures?. Goal of the Class To develop an understanding of the file I/O process. Software must be able to interact

History of File Structures

Advances in operating systems gave rise to more research in operating systems. The ability to multi-task processes was a new concept. Disk drives were slow (and still are) and became a big bottleneck in software. It was important to come up with ways to speed up the file I/O process.

Page 6: Comp 335 – File Structures Why File Structures?. Goal of the Class To develop an understanding of the file I/O process. Software must be able to interact

How SLOW is a disk drive? To the human, disk drives are extremely fast. Higher end

computers like servers can purchase 10K to 15K RPM. For consumers, laptops and most desktops are 5400 or 7200 RPM.

However, when compared to a computer, disk drives are very slow, especially when comparing them to the speed of a CPU and main memory processes.

CPU (nanoseconds, one-billionth of a second), Disk accesses (milliseconds, one-thousandth of a second)

SSDs are becoming more common. Faster because there are no moving parts, but expensive.

Page 7: Comp 335 – File Structures Why File Structures?. Goal of the Class To develop an understanding of the file I/O process. Software must be able to interact

Comparing CPU speed to Disk speed

Assume a RAM access is 120 nsAssume a Disk access is 30 ms.

How many RAM accesses can be made in the time it takes to do one disk access?

Answer: ?

Folk and Zoellick (File Structures, An Object-Oriented Approach using C++) mention in human terms that if a RAM access were 20 SECONDS the DISK access take 58 DAYS!

Page 8: Comp 335 – File Structures Why File Structures?. Goal of the Class To develop an understanding of the file I/O process. Software must be able to interact

History of File Structures

The development of high level languages moved file processing from a physical level (hardware dependent) to a logical level (software dependent with the OS handling the specifics of the hardware).

Code became more portable but lost some in the efficiency area.

Page 9: Comp 335 – File Structures Why File Structures?. Goal of the Class To develop an understanding of the file I/O process. Software must be able to interact

History of File Structures

Today, with shared data everywhere (networks, internets, etc…) efficient file structures are even more crucial. People want data fast. Crowded networks do not need extra bits to transmit.

Page 10: Comp 335 – File Structures Why File Structures?. Goal of the Class To develop an understanding of the file I/O process. Software must be able to interact

File Structure Technique Chronology

Sequential techniques - sequential search thru a file Indexing – traversing more than one file to access data Tree structures

AVL – self balancing concept, faster access B-tree – large branching factor from a node

Hashing - one access only to desired data achieved by converting a record key to the storage address of the data

Techniques continually improved on access time to get to the data. This is the most crucial element in file structure design.

A file structure is a combination of data representation on file and the operations for accessing this data.

Page 11: Comp 335 – File Structures Why File Structures?. Goal of the Class To develop an understanding of the file I/O process. Software must be able to interact

Understanding Disk Drives

Terms: Seek Rotational Latency Read/Write Time Platter Read/Write head Spindle speed Cylinder Track Sector/Cluster

Hard Disk Drive Basics

Page 12: Comp 335 – File Structures Why File Structures?. Goal of the Class To develop an understanding of the file I/O process. Software must be able to interact

Understanding Disk Drives

Page 13: Comp 335 – File Structures Why File Structures?. Goal of the Class To develop an understanding of the file I/O process. Software must be able to interact

Understanding Disk Drives

Page 14: Comp 335 – File Structures Why File Structures?. Goal of the Class To develop an understanding of the file I/O process. Software must be able to interact

Understanding Disk Drives

Page 15: Comp 335 – File Structures Why File Structures?. Goal of the Class To develop an understanding of the file I/O process. Software must be able to interact

Disk Drive Videos

Inside a computer disk drive Engineering viewpoint of a disk drive

Page 16: Comp 335 – File Structures Why File Structures?. Goal of the Class To develop an understanding of the file I/O process. Software must be able to interact

Review

RAMAC Why are disk drives slow? Purpose of file structures File structure techniques