11 Database Security
11 Database Security
4. Integrity
• Integrity constraints contribute to
maintaining a secure database system by
preventing data from becoming invalid., and
hence giving misleading or incorrect results.
5. Encryption
• This is the encoding of the data by a special
algorithm that renders the data unreadable by
any program without the decryption key.
COUNTER MEASURES
• If a DB system holds particularly sensitive data , it
may be deemed necessary to encode it as a
precaution against possible external threats or
attempts to access it.
• Some DBMS’s provide an encryption facility for that
purpose.
• Encryption protects also data transmitted over
communication lines.
COUNTER MEASURES
6. RAID(Redundant Array of Independent Disks)
• The hardware that the DBMS is running on
must be fault tolerant, meaning that the
DBMS should continue to operate even if one
of the hardware components fails.
• This suggests having redundant components
that can be seamlessly integrated into a
working system whenever there is one or
more components failures.
COUNTER MEASURES
• The main hardware components that should be
fault-tolerant include disk drives, disk controllers,
CPU, power supplies and cooling fans.
• RAID works on having a large disk array comprising
an arrangement of several independent disks that are
organized to improve reliability and at the same time
increase performance.
• Performance is increased through data striping
where data is segmented into equal- size partitions
(the striping unit) which are temporarily distributed
across multiple disks.
COUNTER MEASURES
• This gives the appearance of a single large, fast disk
where in actual fact the data is distributed across
several smaller disks.
• Striping improves overall I/O performance by
allowing multiple I/O’s to be serviced in parallel.
• At the same time, data stripping also balances the
load among disks.
• Reliability is improved through storing redundant
information across the disks using a parity scheme or
an error-correcting scheme.
COUNTER MEASURES
• In a parity scheme, each byte may have a
parity bit associated with it that records
whether the number of bits in the byte that are
set is even or odd.
– If the number of bits in the byte becomes
corrupted, it will not match the stored parity
• Error-correcting schemes store two or more
additional bits, and can reconstruct the
original data if a single bit becomes corrupt.
• This schemes can be used through stripping
bytes across disks.
RAID Levels
RAID O – Non-redundant – This level maintains no redundant
data and so has the best write performance since updates do
not have to be replicated.
– Data stripping is performed at the level of blocks.
– In this level, a striped array of disks is implemented.
– The data is broken down into blocks and the blocks are
distributed among disks.
– Each disk receives a block of data to write/read in
parallel.
– It enhances the speed and performance of the storage
device.
– There is no parity and backup in Level 0.
RAID Levels
RAID O – Non-redundant
RAID Levels
RAID I – Mirrored – Maintains (mirrors) two identical copies
of the data across different disks.
• When data is sent to a RAID controller, it sends a copy of
data to all the disks in the array.
• RAID level 1 provides 100% redundancy in case of a failure.
• It’s the most expensive storage solution
RAID O + I – Non-redundant and Mirrored – Combines
striping and mirroring.
RAID Levels
RAID I – Mirrored
RAID Levels
RAID 2 – Memory-style Error correcting codes:
• The striping unit in this level is a single bit and
hamming codes are used as the redundancy scheme.
– RAID 2 records Error Correction Code using Hamming
distance for its data, striped on different disks.
– Like level 0, each data bit in a word is recorded on a
separate disk and ECC codes of the data words are stored
on a different set disks.
– Due to its complex structure and high cost, RAID 2 is not
commercially available.
RAID Levels
RAID 2 – Memory-style Error correcting codes:
RAID Levels
• RAID 3 – Bit- Interleaved Parity – Provides
redundancy by storing parity information on a single
disk in the array which can be used to recover the
data on the disks should they fail.
– RAID 3 stripes the data onto multiple disks.
– The parity bit generated for data word is stored on a
different disk.
– This technique makes it to overcome single disk failures.
RAID Levels
RAID 3 – Bit- Interleaved Parity
RAID Levels
• RAID 4 – Block Interleaved Parity – In this level the
striping unit is a disk block and a parity block is
maintained on a separate disk for corresponding
blocks from a number of other disks.
– If one disk fails, the parity block can be used with the
corresponding blocks from the other disks to restore the
blocks of the failed disk.
– Process: an entire block of data is written onto data disks
and then the parity is generated and stored on a different
disk.
• Note that level 3 uses byte-level striping, whereas level 4 uses
block-level striping. Both level 3 and level 4 require at least
three disks to implement RAID.
RAID Levels
• RAID 4 – Block Interleaved Parity
RAID Levels
RAID 5 – Block- Interleaved Distributed Parity – Uses a
parity data for redundancy in a similar way to RAID 3
but strips the parity data across all the disks.
– RAID 5 writes whole data blocks onto different disks, but
the parity bits generated for data block stripe are
distributed among all the data disks rather than storing
them on a different dedicated disk.
RAID Levels
RAID 5 – Block- Interleaved Distributed Parity
RAID Levels
• RAID 6 – P+Q Redundancy – Similar to RAID 5 but
additional redundant data is maintained to protect
against multiple disk failures.
• Error correcting codes are used instead of using
parity.
– In this level, two independent parities are generated and
stored in distributed fashion among multiple disks.
– Two parities provide additional fault tolerance.
– This level requires at least four disk drives to implement
RAID.
RAID Levels
RAID 6 – P+Q Redundancy