Data Storage Flashcards
Describe features of primary storage
<ul> <li>Fast</li> <li>Expensive</li> <li>Volatile</li> </ul>
What does primary storage hold?
Data that needs to be operated on
Describe features of secondary storage
<ul> <li>Moderately fast</li> <li>Cheaper</li> <li>Non-volatile</li> </ul>
What does secondary storage hold?
Data that is not currently being operated on
Describe features of tertiary storage
<ul> <li>Slow</li> <li>Cheap</li> <li>Non-volatile</li> <li>Durable</li> </ul>
What does tertiary storage hold?
Archival data, long term back ups
What is a block?
Unit of storage allocation and of data transfer between secondary and primary storage
Continguous sequence of sectors from a single track
What is a typical block size today?
Between 4 and 8 kilobytes
What is the formula for a cost of a block access?
access time + (block size/data transfer rate)
What are the assumptions for a fixed length record?
<ul>
<li>Record size is fixed</li>
<li>Each file has records of one particular type only</li>
<li>Different files are used for different relations</li>
<li>Each record is entirely contained in a single block</li>
<li>No record is larger than a block</li>
</ul>
Describe the simple approach to storing fixed length records
Attributes are stored in order, store record i starting from byte n x i where n is the size of each record
What are the problems with the simple approach for storing fixed length records?
<ul>
<li>Need maximum allocation per field, wasteful</li>
<li>Block size unlikely to be multiple of record size</li>
</ul>
What are the three ways deletion can be dealt with in fixed length record storage?
<ol>
<li>Compact records by shifting them left</li>
<li>Move record n into the gap</li>
<li>Fill the gap on the next insertion</li>
</ol>
What are free lists?
A way to arrange the data structure to hold where the deleted records are
How do free lists work?
Store the address of the first deleted record in the file header, then the first deleted record stores the address of the second deleted record and so on
How does insertion work with a free list data structure?
Use the pointer from the header, then change the header to point to the next one
Describe a variable length record
The length of the record varies depending on how much data must be stored