5.1.1 Three Type of file structure
UNSTRUCTURED
Unstuctured Stream
• Data are collected in the order they arrive• Purpose is to accumulate a mass of data and save it
• Records may have different fields
• No structure
• Record access is by exhaustive search
Unstructured Stream Performance
•Update–Same size record - okay
–Variable size - poor
•Retrieval
–Single record - poor
–Exhaustive - okay
STRUCTURED
File Structure Abstractions
•Three kinds of files
–byte sequence
–record sequence
–key-based, tree structured
•e.g. IBM’s indexed sequential access method (ISAM)
File Structure Abstractions
Stream of Bytes• OS considers a file to be unstructured
• Simplifies file management for the OS
• Applications can impose their own structure
• Used by UNIX, Windows, most modern OSes
Records
• Collection of bytes treated as a unit
• Example: employee record
• Operations at the level of records (read_rec,write_rec)
• File is a collection of similar records
• OS can optimise operations on records
TREE
Hierarchical, or Tree-Structured Directory
•Files can be located by following a path from the root, or master, directory down various branches–This is the absolute path name for the file
•Can have several files with the same file name as long as they have unique path names
File Sturcture Abstractions
•Tree of Records–Records of variable length
–Each has an associated key
–Record retrieval based on key
–Used on some data processing systems (mainframes)
•Mostly incorporated into modern databases
Comments
Post a Comment