0% found this document useful (0 votes)
11 views5 pages

Business Objects Design

Uploaded by

kdravidamani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views5 pages

Business Objects Design

Uploaded by

kdravidamani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

RAID Level – 4 Vs Level – 2,3

- Reads are simple to understand


- want to read block A, read it from disk 0
- if there is an error, read in blocks B,C, D, and parity block and calculate correct data
- What about writes?
- it looks like a write still requires access to 4 data disks to recalculate the parity data
- not true, can use the following formula
new parity = (old data xor new data) xor old parity
- a write requires 2 reads and 2 writes
- Doing multiple small reads is now faster than before
- However, writes are still very slow
- this is because of calculating and writing the parity blocks
- Also, only one write is allowed at a time
- all writes must access the check disk so other writes have to wait.
RAID Level - 5
- Level-5 stripes file data and check data over all the disks
- no check disk is used.
- no more write bottleneck
- Drastically improves the performance of multiple writes
- they can now be done in parallel
- Slightly improves reads
- Notice that for Level-4, a write to sector 0 on disk 2 and sector 1 on disk 3 both require a write to disk
five
for check information.
- In Level-5, a write to sector 0 on disk 2 and sector 1 on disk 3 require writes to different disks for check
information (disks 5 and 4, respectively).
- Best of all worlds
- read and write performance close to that of RAID Level-1
- requires as much disk space as Levels-3,4
RAID Level - 10 (Striping/Mirroring)
- Combine Level-0 and Level-1
- Stripe a files data across multiple disks
- gives great read/write performance
- Mirror each strip onto a second disk
- gives the best redundancy
- The most high-performance system.
- The most expensive system.

4.2 File Organization, Organization of Records in Files

File Systems Organization: direct ah SIP


– Sequential, Pointer, Indexed, Direct.

Basics:
- A database is a collection of files, file is a collection of records, record (tuple) is a collection of fields
(attributes).
- Files are stored on Disks (that use blocks to read and write).
- Two types of records.
1. Fixed Length Record
2. Variable Length Record.
Two important issues:
1.Representation of each record
2.Grouping/Ordering of records and storage in blocks.
Goal and considerations:
- Compactness
- Overhead of insertion/deletion
Retrieval Speed: Sometime we prefer to bring more records/tuples than necessary in MM(Memory
Management) and use CPU to filter out the unnecessary ones
Fixed Length Record: Example
Account( acc-number char(10), branch-name char(20), balance real)
Each record is 38 bytes.
Store them sequentially, one after the other.
Record 0 at position 0, record 1 at position 38, record 2 at position 76 etc.
Simple approach:
- Store record i starting from byte n * (i – 1), where n is the size of each record.
- Record access is simple, but records may cross blocks
Modification: do not allow records to cross block boundaries
Insertion of record i: Add at the end.
Deletion of record I : Two alternatives:
- move records:
- do not move records but link all free records on a free list.

2nd approach: FLR with Free Lists


- Store the address of the first deleted record in the file header.
- Use this first record to store the address of the second deleted record, and so on
- Can think of these stored addresses as pointers since they “point” to the location of a record.
- More space efficient representation: reuse space for normal attributes of free records to store
pointers.

Variable Length Records:


Variable-length records arise in database systems in several ways:
- Storage of multiple record types in a file.
- Record types that allow variable lengths for one or more fields.
- Record types that allow repeating fields (used in some older data models).
Byte string representation
- Attach an end-of-record control character to the end of each record.
Slotted Page Structure:

- Slotted page header contains:


- number of record entries
- end of free space in the block
- location and size of each record

- Records can be moved around within a page to keep them contiguous with no empty space
between
them; entry in the header must be updated.
- Pointers should not point directly to record — instead they should point to the entry for the record
in
header.

Pointer method:
- A variable-length record is represented by a list of fixed-length records, chained together via pointers.
- Can be used even if the maximum record length is not known.
Solution is to allow two kinds of block in file:
–Anchor block – contains the first records of chain
–Overflow block – contains records other than those that are the first records of chains.

ORGANIZATION OF RECORDS IN FILES:


Heap – a record can be placed anywhere in the file where there is space.
Sequential – store records in sequential order, based on the value of the search key of each record.
Hashing – a hash function computed on some attribute of each record; the result specifies in which block
of the file the record should be placed.
Records of each relation (table) may be stored in a separate file.
In a clustering file organization records of several different relations can be stored in the same file
- Motivation: store related records on the same block to minimize I/O.

Sequential File Organization:


Suitable for applications that require sequential processing of the entire file.
- The records in the file are ordered by a search-key.

You might also like