Skip to main content

Redundancy with copies

Replication is one of the fundamental mechanisms MooseFS uses to provide data reliability, availability, and fault tolerance. It works by storing multiple copies - of each chunk of a file across different Chunkservers. This ensures that even if one or more servers fail, the data remains accessible and safe.

How Replication Works

Each file chunk is copied and distributed to a number of Chunkservers, based on the Storage Class assigned to the file. These copies are kept in sync by the MooseFS Master, which ensures that missing or outdated copies are automatically repaired or recreated as needed.

The number of copies created for each chunk determines its Redundancy Level. For example:

  • A file with 2 copies has a redundancy level of 1 (one failure can be tolerated).
  • A file with 3 copies has a redundancy level of 2 (two failures can be tolerated).

Replication is always used when chunks are first created, even in systems that later transition some data to Erasure Coding for long-term storage.

Benefits of Replication

Replication offers several advantages:

  • Fast recovery: Since copies are full copies, they can be used instantly without additional processing.
  • Low latency: Clients can read from the nearest or least-loaded copy, reducing access time.
  • Simplicity: It requires less CPU and memory overhead than Erasure Coding, making it a good default for active or frequently updated data.

Use Cases

Replication is ideal for:

  • Frequently accessed or performance-sensitive data
  • Small or mid-sized deployments where storage efficiency is not a primary concern
  • Temporary or newly written data that may still be changing

In large-scale environments, replication is often used in combination with Erasure Coding - new data is replicated for performance, and later converted to EC for storage efficiency.

Integration with Storage Classes

Replication in MooseFS is defined using Storage Classes, where label expressions specify how many copies to make and where to store them. For example, a class defined as 2A means “store two copies of each chunk on servers labeled A.”

You can configure separate replication strategies for different file types, directories, or usage patterns, and MooseFS will handle distribution and recovery automatically.

Summary

Replication in MooseFS is a reliable, straightforward approach to data protection. It provides immediate redundancy and performance benefits, making it suitable for active data and operational simplicity. As part of a broader storage strategy, replication often serves as the first stage in the data lifecycle before transitioning to more space-efficient methods like Erasure Coding.

For configuration details, see the Storage Class Administration and Redundancy Control chapters.