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 are flash drives and hard drives. These devices store various types of data like 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 like a hard drive, instead of a temporary file or volatile memory like RAM.
Storage is one of a computer system’s core components and can be categorized into many types, but there are two primary types:
A storage device that requires a continuous supply of electricity for data storage/retention. This storage serves as the primary storage for temporarily storing data and managing the workloads of applications. Cache memory and random access memory are examples of nonvolatile storage (RAM).
A 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.
In distributed systems, Redundancy is the duplication of critical components (web server, database server, etc.) to increase reliability and availability. This concept provides a backup or failsafe, ensuring that the system continues to operate even if few components fail. 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 point that can lead to system 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.
In passive redundancy, we duplicate components in a system without actively using them. When the primary component is functioning correctly, duplicated components stay in a standby or passive state. During the passive state, the redundant component monitors the primary component's status and waits for a failure event. Once a failure is detected, the redundant component will take over the task of the failed component.
Note: In some distributed systems, the decision for the standby component to take over from the primary can be made by other components or depend on the system architecture.
Some distributed systems requirements directly align well with passive redundancy. For example, when data retrieval speed is not critical (data archiving systems), the passive state of redundant storage devices can be used for backup and recovery purposes.
In active redundancy, multiple identical components are simultaneously active in parallel, executing tasks concurrently and sharing the workload. In other words, they all actively contribute to the system's operations at the same time and work in a coordinated manner.
There are some critical points to consider:
In distributed systems, the terms "redundancy" and "replication" are often used interchangeably. Both concepts involve having multiple nodes, components, or processes in a system, but they serve different purposes.
Enjoy learning, Enjoy system design!
Subscribe to get well designed content on data structure and algorithms, machine learning, system design, object orientd programming and math.
©2023 Code Algorithms Pvt. Ltd.
All rights reserved.