Monday 11 April 2011

ASE : RAID and Sybase

Here's a short summary of what you need to know about Sybase and RAID.

The newsgroup comp.arch.storage has a detailed FAQ on RAID, but here are a few definitions:

RAID
RAID means several things at once. It provides increased performance through disk striping, and/or resistance to hardware failure through either mirroring (fast) or parity (slower but cheaper).

RAID 0
RAID 0 is just striping. It allows you to read and write quickly, but provides no protection against failure.

RAID 1
RAID 1 is just mirroring. It protects you against failure, and generally reads and writes as fast as a normal disk. It uses twice as many disks as normal (and sends twice as much data across your SCSI bus, but most machines have plenty of extra capacity on their SCSI busses.)

Sybase mirroring always reads from the primary copy, so it does not increase read performance.

RAID 0+1
RAID 0+1 (also called RAID 10) is striping and mirroring together. This gives you the highest read and write performance of any of the raid options, but uses twice as many disks as normal.

RAID 4/RAID 5
RAID 4 and 5 have disk striping and use 1 extra disk to provide parity. Various vendors have various optimizations, but this RAID level is generally much slower at writes than any other kind of RAID.

RAID 7
I am not sure if this is a genuine RAID standard, further checking on your part is required.


Details
Most hardware RAID controllers also provide a battery-backed RAM cache for writing. This is very useful, because it allows the disk to claim that the write succeeded before it has done anything. If there is a power failure, the information will (hopefully) be written to disk when the power is restored. The cache is very important because database log writes cause the process doing the writes to stop until the write is successful. Systems with write caching thus complete transactions much more quickly than systems without.

What RAID levels should my data, log, etc be on? Well, the log disk is frequently written, so it should not be on RAID 4 or 5. If your data is infrequently written, you could use RAID 4 or 5 for it, because you don't mind that writes are slow. If your data is frequently written, you should use RAID 0+1 for it. Striping your data is a very effective way of avoiding any one disk becoming a hot-spot. Traditionally Sybase databases were divided among devices by a human attempting to determine where the hot-spots are. Striping does this in a straight-forward fashion, and also continues to work if your data access patterns change.

Your tempdb is data but it is frequently written, so it should not be on RAID 4 or 5.

If your RAID controller does not allow you to create several different kinds of RAID volumes on it, then your only hope is to create a huge RAID 0+1 set. If your RAID controller does not support RAID 0+1, you shouldn't be using it for database work.

No comments:

Post a Comment