Storage and Redundancy in System Design

A storage device is a hardware component used primarily for data storage. It provides a way for computers to save data, either temporarily or permanently. Examples of storage devices include flash drives and hard drives. These devices allow users to store various forms of information, such as videos, documents, photos, and raw data.

Persistence: Persistence is the ability of an object or state to remain unchanged even after the process that created it has stopped or the computer has shut down. When data needs to persist, it is saved in a non-volatile storage location, such as a hard drive, instead of a temporary file or volatile memory like RAM.

Types of Storages

Storage is one of a computer system’s core components and can be categorized into many types, but there are two primary types:

Volatile Storage (Memory)

A continuous supply of electricity is required for data storage/retention. This storage serves as the primary storage of a device for temporarily storing data and managing workloads of applications. Cache memory and random access memory are examples of nonvolatile storage (RAM).

Non-Volatile Storage

A sort of storage device that preserves digital data even though it is turned off or electrical power is not supplied. This is often referred to as a secondary storage device and is used for I/O operations involving permanent data storage. A hard disc, USB storage, and optical media are examples of volatile storage.

Redundancy

Redundancy is the duplication of critical components or functions of a system to increase its reliability or performance. This concept provides a backup or failsafe, ensuring that the system continues to operate even if one component fails. The term redundancy is used because if everything is working correctly, the duplicate device or competent does nothing and is redundant.

Redundancy comes into play when we need to prevent a single point of failure (a single point of failure in a system is a point that can lead to the system’s failure). By duplicating or adding components, the system becomes more resilient and less prone to failure. For example, consider a system that includes two identical web servers that are managed by a load balancer. Traffic from clients is evenly distributed between the two servers, but if one fails, the load balancer redirects all traffic to the remaining, functioning server. In this way, redundancy eliminates the single point of failure and enhances the reliability of the system.

Passive Redundancy: In this type of redundancy, multiple components are present at a given layer of the system. If one component fails, the remaining components automatically take over and prevent any system failure.

Active Redundancy: In active redundancy, multiple machines work together, with one or a few handling traffic or performing tasks. If one machine fails, the other machines detect the failure and take over. This ensures that the system continues to function even if one component fails.

Redundancy vs. Replication

The terms "redundancy" and "replication" are often used interchangeably, but they have distinct meanings. Both concepts involve having multiple nodes, components, or processes in a system, but they serve different purposes.

Redundancy: Refers to having more than one node/component/process in a system, which is useful in managing failovers. If one node fails, another node in the system will take over and continue to function. There are two types of redundancy:

  • Active redundancy: In this, all traffic is distributed across all nodes at the same time.
  • Passive redundancy: One node receives the traffic and in case of failure, traffic is redirected to another node.

Replication: This includes redundancy, but it also involves copying data from one node to another or synchronizing the state between nodes. There are two types of replication:

  • Active replication: Each node receives every message to keep in sync with the other nodes.
  • Passive replication: This is the master-slave model, where the master node receives all requests and forwards them to the slave nodes.

In short:

  • Replication is the synchronization of state between redundant nodes whereas Redundancy is the duplication of nodes, in case of some of them are failing. 
  • Replication ensures Consistency while Redundancy increases reliability.

Enjoy learning, Enjoy system design!

More From EnjoyAlgorithms

© 2022 Code Algorithms Pvt. Ltd.

All rights reserved.