RAID and Ingres

Tony Salter

Presented at CA-World '99

Abstract This article is a brief summary of a talk given at CA-World 99. As the talk itself was an introduction to the subject, it necessarily follows that this article only skims the surface!

RAID (Redundant Array of Inexpensive Disks) technology was developed at Berkeley in the 80s as a way of configuring several small unreliable disks to provide larger and/or more resilient volumes. The advances in disk technology in recent years have removed some of the original need for RAID. It can, however, still play a useful role in the disk subsystem of an Ingres system.


In the discussion below the term disk is used to refer to a physical disk, whereas the term volume is used to describe the logical volume formed by combining disks. Each of the common types of RAID is identified by a number and is described below:

RAID 0 Usually known as Striping. Consists of dividing the data into chunks, each of a number of disk blocks, which are allocated in turn to the constituent disks. Large pieces of data are therefore spread over multiple disks. This technique provides large volumes with no wasted space but has decreased resilience as the failure of any disk results in the effective loss of all data. Performance can improve as the workload is automatically spread over all of the disks.

RAID 1 Usually known as Mirroring. Consists of a pair of disks which are an exact copy of each other. Volume size is not increased but considerable resilience is added if one disk fails the other still has all of the data. Write performance can be slower (as both disks have to be updated) whereas read performance can improve as either disk can be used.

RAID 5 Usually known as Stripe with Parity. Similar to Striping except that each set of chunks (e.g. the corresponding chunks on each disk) are check-summed together to produce an additional chunk which is also written to disk. This adds resilience in that if any one disk is lost the data on it can be derived from the remaining data and the checksum, all be it slowly!. Volume size is increased at a much reduced cost in terms of wasted space. Write performance can be considerably slower due to the extra i/o involved in producing the checksum. Read performance is as for RAID 1.

RAID 0/1 As its name implies this is a combination usually mirrored pairs of disks are stripped. This produces large redundant volumes, although with a high space cost. Performance can go either way depending on the workload.

How can Ingres make use of RAID? To answer this I will describe which RAID type I would use for some of the major Ingres locations in a typical medium sized system. Dont take this as gospel every system has different requirements and constraints.

The log file should be kept on RAID 1. It is not large (relative to disk size) but resilience and performance are critical. I would also ensure this was a dedicated volume, even if this meant having unused space.

The checkpoint files should be on RAID 5 as they are large, with critical write performance, but minimal resilience requirement (assuming they are subsequently written to tape).

The data location(s) should be on RAID 0/1 as this gives large resilient volumes with good performance.

An interesting debate can be entered into on when to use RAID and when to use the facilities of Ingres itself. Two examples illustrate this: (1) Ingres II provides dual log file support so why use RAID 1?. (2) Why stripe data when Ingres allows multiple locations? There is a case to be made for both possibilities but that will have to wait for another article!

© Rational Commerce Limited, 1999