ADD

Tuesday, 17 May 2016

LEVELS OF RAID / LEVEL OF REDUNDANCY

LEVELS OF RAID / LEVEL OF REDUNDANCY 

In  the following discussion, we discuss the different RAID levels, where we are considering some sample that would just fit on four disks. It means that,without any RAID technology, our storage system would contain exactly four data disks, BUT,depending on the RAID level chosen in the RAID technology, our storage system would vary from zero disk to four disk.

1. Level 0 : Non- redundant :  A RAID Level 0 system uses data stripping to increase the maximum bandwidth available. No redundant information is maintained. While being the solution with the     lowest cost, reliability is a problem, since the MTTF decreases linearly with the number of disk       drives in the array. RAID level 0 has the best write performance of all RAID levels, because             absence of redundant information implies that no redundant information needs to be updated! RAID level 0 does not have the best read performance of all raid levels,  since systems with redundancy have a choice of scheduling disk accesses. 
     In our example, the RAID Level 0 solution consists of only four data disks. Independent of the number of data disks, the effective space utilization for a RAID Level 0 system is always 100 percent.


2. Level 1 : Mirrored : A RAID Level 1 system is the most expensive solution . Instead of having one copy of the data, two identical copies of the data on two different disks are maintained. This type of redundancy is often called mirroring. Every write of a disk block involves a write on both disks. These writes may not be performed simultaneously, since a global system failure (Ex : due to power outrage) could occur while writing the blocks and then leave both copies in an inconsistent state. Therefore, we always write a block on one disk first and then write the other copy on the mirror disk.
       In our example, we need for data and four check disks with mirrored data for a RAID Level 1 implementation. the effective space utilization is 50 percent independent of the number of data disks.


3. level 0+1 : Stripping and Mirroring : RAID Level 0+1 : Stripping sometimes also referred to as Raid Level 10 - combines stripping and mirroring - Thus, as in RAID Level 1, read requests of the size of a disk block can be scheduled both  to a disk or its mirror image. In addition, read requests of the size of several contiguous blocks benefit from the aggregated bandwidth of all disks. the cost for writes is an analogous to RAID Level 1. 
           In our example, four data disk require four check disks and effective space utilization is always 50 percent.


4. Level 2 : Error- Correcting Codes : In RAID Level 2 the stripping unit is a single bit. The redundancy scheme used in hamming code. in our example with four data disks, only three check disks are needed. In general, the number of check disks grows logarithmically with the number of data disks. Stripping at the bit level has the implication that in a disk array with D data disks, the smallest unit of transfer for a read is a set of D blocks. Thus, Level  2 is good for workloads with many large requests since for each request the aggregated bandwidth of all data disks is used. But RAID Level 2 is bad for small requests of the size of an individual block for the same reason.
For a RAID Level 2 implementation with for data disks, there check disks are needed. Thus in our example the effective space utilization is about 57 percent. The effective space utilization increase with the number of data disks. For example, in a setup with 10 data disks, four check disks are needed and the effective space utilization is 71 percent. in a setup with 25 data disks, five check disks are required and the effective space utilization grows to 83 percent.



5. Level 3 : bit - Interleaved parity :  While the redundancy scheme used in RAID Level 2 improve in terms of cost upon RAID Level 1, it keeps more redundant information than is necessary. Hamming Code, as used in RAID Level 2, has advantage of being able to identify which disk has failed. But disk controllers can easily detect which disk has failed. Thus, the check disks do not need to contain information to identify the failed disk.information to recover the lost data is sufficient. Instead of using several disks with to store hamming Code, RAID Level 3 has a single check disk with parity information. Thus, the reliability overhead for RAID Level 3 is a single disk, the lowest overhead possible.
The performance characteristics of RAID Level 2 and RAID Level 3 are very similar. RAID Level 3 can also process only are Input / Output at a time, the minimum transfer unit is D blocks, and a write requires a read - modify - write cycle.


6. level 4 : Block - Interleaved Parity : RAID Level 4 has a stripping unit of a disk block, instead of a single bit as in RAID level 3, Block - level stripping has the advantage that read requests of the size of a disk block can be served entirely by the disk where the requested block resides. Large read requests of several disk blocks can still utilize the aggregated bandwidth of the D disks.
The write of a single block still requires a read - modify - write cycle, but only one data disk and the check disk are involved. The parity on the check disk can be updated without reading all D disk blocks because the new parity can be obtained by noticing the differences between the old data block and the new data block and them applying the difference to the parity block on the check disk :
New parity = (Old Data XOR New Data) XOR (Old parity).
RAID Level 3 and 4 configurations with four data disks require just a single check disk. Thus, in our example, the effective space utilization is 80 percent. The effective space utilization increases with the number of data disks, since always only one check disk is necessary.

7. Level 5 : Block - Interleaved Distributed Parity : RAID Level 5 improves upon Level 4 by distributing the parity blocks uniformly over all disks, instead of storing them as a single check disk. This distribution has two advantages. First, several write requests can potentially be processed in parallel, since the bottleneck of a unique check disk has been eliminated. second, read request have a higher level of parallelism. since the data is distributed over all disks, read request involve all disks, whereas in systems with a dedicated check disk never participate in reads.
A RAID Level 5 system has the best performance of all RAID levels with redundancy for small and large read and large write requests. Small writes still require a read - modify - write cycle and are thus less efficient than in RAID Level 1.
In our example, the corresponding RAID Level 5 system has 5 disks overall and thus the effective space utilization is the same as in RAID level 3 and 4.

8. Level 6 : P + Q Redundancy : A RAID Level 6 system uses Read - Solomon codes to be able to recover from upto two simultaneous disk failure. RAID Level 6 requires to check disks, but it also uniformly distributes redundant information at block level as in RAID Level 5 - Thus, the performance characteristics per small and large read requests and for large write requests are analogs to RAID Level 5. For small writes, the read - modify - write procedure involves 6 instead for four disks as compared to RAID Level 5, since two blocks with redundant information need to the updated.
   For a RAID Level 6 system with storage capacity equal to four data disks, six disks are required. Thus, in our example, the effective space utilization is 66 percent.


Monday, 16 May 2016

REDUNDANCY

REDUNDANCY 

In redundancy technique, we store duplicate (copy) of original information, that is not needed normally, But that can be used in the case of a disk failure so that it can replace the contents of last information. thus, even if a disk fails, data is not lost, so that the Mean Time To Failure (MTTF) is increased. Moreover. by storing redundant information on disks, the reliability can be improved. 
         When implementing redundancy into disk array design, we have to make two choices. 
        First we have to decide where to store the redundant information i.e., we can either store the redundant information on a single disk (or) we can distribute the redundant information uniformly over all disks. 
Second, we have to decide how to retrieve the redundant information. To retrieve the redundant information. the disk arrays uses the parity scheme, which contains an extra disk known as check disk that can be used to recover from failure if any disk fails. This is done, by maintaining a parity bit: that is if the disk contains information such as 1101, here the number of '1' is odd.then the first bit on the check disk known as parity bit is set to 1. Likewise, if the disk contain even number of 1's, then the check disk parity bit is set to 0. 
            Therefore, suppose if a disk fails then first count the number of 1's in failed disk, if it is odd then check its related parity bit in check disk which should be 1 , if both are not matching i.e., if there is odd number of 1's and parity bit is 0, then it means we have corrupted one 1 in failed disk, i.e., if parity bit is 0 there should be even number of 1's and we have first counted it was odd, so add one 1 to recover lost data.
                    Example : if the disk was 11101 before failure, so we have parity bit even as 0 then after failures it was 11001 i.e., odd number of 1's but parity bit maintained for the disk was 0. then we have corrupted one 1 so immediately add one 1 to the failure disk information to make it even number of 1's. Thus, with parity we can recover from failure of any one disk.


RAID

RAID - REDUNDANT ARRAYS OF INDEPENDENT DISKS

A disk array is an arrangement of several disks together. organized  so as to increase the performance and improve reliability storage system. 
  In simple words, performance is increased through data stripping because  it distributes data over several disks to give the impression of having a single large, very fast disk. But Reliability is improved part redundancy because instead of having single copy of the data. redundant (duplicate or copy) information is painted so that in case  of a disk failure, it can be used to reconstruct the contents of the failed disk.
          Therefore, in short, disk arrays that implements a combination of both i.e., data stripping and redundancy are called as "Redundant Arrays of independent disks", or in short, "RAID" to improve both i.e., performance and Reliability respectively.
           several RAID organizations, referred to as RAID levels, have been proposed. Each RAID level represents a different trade off between reliability and performance as follows.


Data Stripping 

Data stripping is the process where a single large file is divided into a small - small equal pieces and stores these piece of a file on different disks.


Data stripping uses parallelism to improve disk performance by distributing data over multiple disks to make them appear as a single large, fast disk. stripping improves overall Input/Output
performance by allowing multiple Input/Output to be serviced in parallel, thus providing high overall transfer rates. Data stripping also accomplishes load balancing among disks.



DISK BLOCK COMPONENTS

THE TIME TO ACCESS A DISK BLOCK HAS FOLLOWING COMPONENTS

  1. Seek time : Seek time is defined as the time taken to move the disk heads to the track on which a desired block is located.  
  2. Rotational delay : Rotational delay is defined as the waiting time for the desired block to rotate under the disk head; it is the time required for half a rotation on average and is usually less than seek time.
  3. Transfer Time : Transfer time is defined as the time to actually read or write the data in the block once the head is positioned. that is, the time for the disk to rotate over the block. 
THE PERFORMANCE OF DISK STRUCTURE DEPENDS UPON THE FOLLOWING THREE PRINCIPLES :
  1. Data must be in memory for the DBMS to operate on it.
  2. The unit for data transfer between disk and main memory is block; if a single item on a block is needed. the entire block is transferred. Reading or writing a disk block is called an I/O (input/output) operation.
  3. The time to read for write a block varies, depending on the location of the data : 
             access time = seek time + rotational delay + transfer time. 
These observations imply that the time taken for database operations is affected significantly by how data is stored on disks.




Sunday, 15 May 2016

MAGNETIC DISKS

MAGNETIC DISKS

Magnetic Disk are used for storing large amounts of data. The storage capacity of a single disk ranges from 10 MB to 20 GB. Magnetic disks support direct access to a desired location and are widely used for the database applications. A DBMS provides access to data on disk ; applications of DBMS should not worry about, whether data is in main memory are disk.
    The most basic unit of data on the disk is a single bit of information. By magnetizing an area on disk in certain ways, one can make a bit value to represent either in 1 or 0. To code information, bits are grouped into bytes (bytes or characters). Byte sizes are equal to 4 to 8 bytes, depending on the computer and the device. We assume that one character is stored in a single byte, and we used the terms byte and character interchangeably. The capacity of a disk is the number of bytes it can store, which is very large. small floppy disk used with micro computers holds from 400 KB to 1.5 MB; hard disks for micro - typically hold from several hundreds MB to few GB: and large disk packs used with minicomputers and mainframes have capacities that range up to a few tens or hundred of  GB. Disk capacities continue to grow as technology improves. Data is stored on disk in units called disk blocks. A disk block is a contiguous sequence of bytes and is the unit in which data is written to a disk and read from a disk.


         Blocks are arranged in concentric rings called tracks, on one or more platters. Tracks can be recorded on one or both surfaces of platter.
We refer to platters as single - sided or double - sided accordingly. 
The set of all tracks with the same diameter is called a cylinder, because the space occupied by these tracks is shaped like a cylinder; a cylinder contains one track per platter surface.

DBMS STORAGE MEDIA




DBMS STORAGE MEDIA

FILE ORGANIZATION : STORAGE MEDIA 

introduction:

the physical or internal level, organization of a  database system is concerned with the efficient storage of information in the secondary storage devices. At this level the user's are no  longer concerned with the view of the database (how data is stored). User can retrieve the data from the physical level to the logical level by providing necessary mapping from the physical level to the logical level . so, the basic problem in physical database representation is to select a suitable file system to store the desired information and retrieve it later. The file consist of  records and a record may consist of several fields.
          The efficiency of a file system depends on how efficiently the operations : Retrieve, Insert, Update and Delete,  can be performed on the file. However, the efficiency of these operations on a particular file may depend on the type of queries the file system needs to process. For example, a sequential file system is more efficient. Where the storage and retrieval of records are performed sequentially. The same file system turns out to be inefficient in an environment where records are to be retrieved or updated randomly.


Data in a DBMS is stored on storage devices such as disks and tapes. The disk space manager is responsible for keeping track of available disk space. the file manager, which provides the abstraction of a file of  records to higher levels of  DBMS code, issues requests to the disk space manager to obtain space on disk. the file management layer requests and frees disk space in units of a page; the size of a page is a DBMS parameter and typical values are 4 KB or 8 KB. the file management layer is responsible for keeping track of the pages in a file and for arranging records within pages.
      When a record is needed for processing, it must be fetched from disk to main memory. The page on which the records resides is determined by the file manager. Sometimes, the file manager uses supporting data structures to quickly identify the page that contains a desired record. After identifying the required page, the file manager issues a request for the page to a layer of DBMS code called the buffer manager. The buffer manager fetches a requested page from disk into a  region of main memory called the buffer pool and tells the file manager, the location of the requested page.

Thus, the glimpse of the physical level in DBMS focuses us on the study of details of memory hierarchy, redundant arrays of independent disks (RAID), disk space management etc. records and a record may consist of several fields.

MEMORY HIERARCHY

MEMORY HIERARCHY

Memory in a Computer system is arranged in a hierarchy, as follows.



at the top, we have primary storage, which consists of cache and main memory , and provides very fast access to data. then comes secondary storage, which consists of slower devices such as magnetic disks. tertiary storage is the slowest class of storage devices; for example, optical disks and tapes.
            all the primary storage level, the memory hierarchy includes at the most expensive end:
cache memory, which is a static RAM (Random Access Memory ) cache memory is mainly used by the CPU to speedup execution programs. the next level of primary storage is DRAM (Dynamic Random Access Memory ), which provides the main work area for the CPU for  keeping programs and data , which is popularly called as main memory . the advantages of  DRAM is its low cost, which continuous to decrease ; the drawback is its volatility and lower speed compared with static RAM.

       At the secondary storage level, the hierarchy includes magnetic disks, as well storage in the form of CD - ROM (Compact Disk - Read Only Memory ) devices.

      At the tertiary storage level, the hierarchy includes optical disks and tapes as the least expensive end.
              The storage capacity anywhere in the hierarchy is measured in kilobytes (k bytes or bytes), megabytes (M bytes or 1 million bytes), gigabytes (G byte or billion bytes), and even terabytes
(1000 G bytes).
  
           programs reside execute in DRAM . Generally, large permanent database reside on secondary storage, and portions of the database are read into and written from buffers is main memory as needed. personal computers and work stations have tens of megabytes of data in DRAM. it is become possible to load a large fraction of the database into main memory. an example is telephone switching applications, which store databases that contain routing and line information in main memory.
     Between DRAM and magnetic disk storage, another form of memory resides, flash memory, which is becoming common, particularly because it is non - volatile. flash memories are high density, high - performance memories using EEPROM (Electrically Erasable programmable Read -only Memory) technology. the advantage of flash memory is the fast access speed; the disadvantage is that an entire block must be erased and written over at a time.
           
         CD - ROM disks store data optically and are read by a laser. CD - ROM s contain pre - recorded data that cannot be overwritten. WORM (Write - Once - Read - Many disks) are a form of optical storage used for archiving data; they allow data to be written once and read any number of times without the possibility of erasing. the DVD (Digital Video Disks) is a recent standard for optical disks allowing fourteen to fifteen gigabytes of storage per disks.
        Tapes are relatively not expensive and can store very large amount of data. when we maintain data for a long period but do expect to access it very often. A Quantum DLT 4000 drive is a typical tape device; it stores 20 GB of data and can store about twice as much by compressing the data.it records data on 128 tape tracks, which can be thought of as a linear sequence of adjacent bytes, and supports a sustained transfer rate of 1.5 MB/sec with uncompressed data (typically 3.0 MB/sec with compressed data). A single DLT 4000 tape drive can be used to access up to seven tapes in a stacked configuration, for a maximum compressed data capacity of about 280 GB.