liveBook · Manning

RAID 1

As explained in PostgreSQL Mistakes and How to Avoid Them

RAID 1 is a RAID level that maintains byte-for-byte copies of data on multiple disks through mirroring.

RAID 1 mirrors data byte for byte across multiple disks, requiring at least two devices. It reduces the impact of a hard-disk crash, but mirroring is not a complete PostgreSQL protection strategy. section 9.1

The tempting redundancy plan

A PostgreSQL installation uses RAID 1 and a standby server with streaming replication. This appears to provide double redundancy, but filesystem corruption is copied identically to every mirrored disk. RAID therefore cannot protect against damaged logical file structures or damaged data. section 9.1

Use RAID 1 with these limits in mind:

  • Expect protection from a disk failure, not from filesystem corruption. section 9.1
  • Treat mirrored disks as identical copies, so corrupted data can become duplicated corruption. section 9.1
  • Do not assume file-level snapshots are automatically safe for PostgreSQL; WAL and data files must remain synchronized. section 9.1
Figure 9.1 A PostgreSQL installation layout demonstrating the double physical redundancy of having a standby server but also RAID1 mirrored disks in each of the servers.
figure

Compare the mirrored disks on each PostgreSQL server with the additional standby server, and see why physical redundancy can still leave shared failure modes. section 9.1

How PostgreSQL Mistakes and How to Avoid Them covers it

How deep it goes
Defines byte-for-byte mirroring and failure boundaries, then stops short of detailed RAID implementation.
Examples
Illustrates RAID 1 through a PostgreSQL server using mirrored disks alongside a streaming-replication standby.
What it assumes
Assumes PostgreSQL storage familiarity while defining RAID, mirroring, disk requirements, and relevant failure modes.
What you can do after
Evaluate RAID 1 as disk-failure redundancy without mistaking it for protection against corruption or unsynchronized PostgreSQL files.
How it connects
Connects RAID 1 with backups, filesystem corruption, streaming replication, WAL, and filesystem snapshots.

Also explained in

Compare how 2 books explain RAID 1 →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of PostgreSQL Mistakes and How to Avoid Them. The section links point to the parts of the book it draws on.