In: Computer Science
1.Storing all blocks of a large file on consecutive disk blocks would minimize
seeks during sequential file reads. Why is it impractical to do so? What do operating
systems do instead, to minimize the number of seeks during sequential
reads?
2. Some databases use magnetic disks in a way that only sectors in outer tracks are
used, while sectors in inner tracks are left unused. What might be the benefits
of doing so?
3. A database administrator can choose how many disks are organized into a
single RAID 5 array. What are the trade-offs between having fewer disks versus
more disks, in terms of cost, reliability, performance during failure, and
performance during rebuild?
4. SSDs can be used as a storage layer between memory and magnetic disks, with
some parts of the database (e.g., some relations) stored on SSDs and the rest
on magnetic disks. Alternatively, SSDs can be used as a buffer or cache for
magnetic disks; frequently used blocks would reside on the SSD layer, while
infrequently used blocks would reside on magnetic disk.
a. Which of the two alternatives would you choose if you need to support
real-time queries that must be answered within a guaranteed short period
of time? Explain why.
b. Which of the two alternatives would you choose if you had a very large
customer relation, where only some disk blocks of the relation are accessed
frequently, with other blocks rarely accessed.
1. Operating systems optimize their disks usage by reducing the volume of the data transferred while making requests consecutive. The advantages of storing all blocks of a large file on consecutive disk blocks are:
a) Efficient utilization of disk space.
b) file blocks can be accessed very fastly.
Buffer caches ensures that disk reads happen only when it is necessary, write buffering will minimize writes, disk scheduling minimize seek distances.
According to this process each file occupies a consecutive set of blocks on the disk. For example, if a file requires n blocks in total d the starting location of given block, then the blocks assigned to the file will be: d, d+1, d+2,…… d+n-1.
2. Some databases uses magnetic disks in a way that only sectors in outer tracks are used while sectors in inner tracks are left unused because :
i) Inner tracks have very less sectors compared to outer tracks to keep slack space on the disk
ii) The transfer rate (the number of sectors read per second) is higher on outer tracks.
3. RAID -means Redundant Array of Independent Disks. It stores the same data in different places on multiple hard disks.There are different levels in it. RAID 5 is one of those levels.
A database administrator can choose at least three disks organized into a single RAID 5 array. but due to performance reasons often it is recommended to use at least five disks. The parity information is striped across the each drive, which enables the array to function even if one drive fails also.
Sometimes It can take more time to rebuild a RAID 5 array, when a disk fails.
Due to its array's architecture that allows read and write operations to span multiple drives which results in better performance than a single drive, but not as high as that of a RAID 0 array.
4. a) As there are moving parts in magnetic disks, random seeks will cost the time. So, I feel it’s better not to choose magnetic disks.
b) As time is an important factor for having a very large customer relation, I won't prefer to choose magnetic disks as it's taking much time for seeking data information.