> For the complete documentation index, see [llms.txt](https://liuyang89116.gitbook.io/system-design/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://liuyang89116.gitbook.io/system-design/chapter/chapter-1/redundency_and_replication.md).

# Redundancy and Replication

Redundancy is the **duplication** of **critical components** or **functions** of a system with the intention of increasing the reliability of the system, usually in the form of a backup or fail-safe, or to improve actual system performance. For example, if there is only one copy of a file stored on a single server, then losing that server means losing the file. Since losing data is seldom a good thing, we can create duplicate or redundant copies of the file to solve this problem.

Redundancy plays a key role **in removing the single points of failure** in the system and provides backups if needed in a crisis. For example, if we have two instances of a service running in production and one fails, the system can failover to the other one.

> redundency -> remove single point failure;

![](https://2407442552-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lpv9LvHzpublmUWisvz%2Fsync%2F3816f47cf098c73aa3f9ddc781ab0af6a95960f5.png?generation=1590987655218838\&alt=media)

\[Replication]\(<https://en.wikipedia.org/wiki/Replication\\_(computing)> means sharing information to **ensure consistency between redundant resources**, such as software or hardware components, to improve reliability, [fault-tolerance](https://en.wikipedia.org/wiki/Fault_tolerance), or accessibility.

Replication is widely used in many database management systems (DBMS), usually with a **master-slave relationship** between the original and the copies. The master gets all the updates, which then ripple through to the slaves. Each slave outputs a message stating that it has received the update successfully, thus allowing the sending of subsequent updates.
