データレプリケーション(Data Replication)

可用性、フォールトトレランス、読み取りパフォーマンスを向上させるために、複数のサーバーに同一のデータコピーを保存するプロセス。

トポロジーには、Primary-Secondary(マスター・スレーブ)と、Active-Active(マルチマスター、CRDT等の競合解決が必要)があります。

        graph LR
  Center["データレプリケーション(Data Replication)"]:::main
  Rel_data_recovery["data-recovery"]:::related -.-> Center
  click Rel_data_recovery "/terms/data-recovery"
  Rel_data_obfuscation["data-obfuscation"]:::related -.-> Center
  click Rel_data_obfuscation "/terms/data-obfuscation"
  Rel_data_integrity["data-integrity"]:::related -.-> Center
  click Rel_data_integrity "/terms/data-integrity"
  classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
  classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
  classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
  classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
  linkStyle default stroke:#4b5563,stroke-width:2px;

      

🧒 5歳でもわかるように説明

秘密のレシピを1冊のノートにだけ書いていると、ノートが燃えたら終わりです。レプリケーションとは、5人の友達にコピーを渡すことです。ノートが燃えても友達が持っています。ただし、レシピを変更したときは、全員に連絡してコピーを書き直してもらう必要があります。

🤓 Expert Deep Dive

CAP定理:ネットワーク分断(P)が発生した場合、システムは一貫性(C)と可用性(A)のどちらかを選択しなければなりません。方式には、同期式(一貫性は高いが遅い)、非同期式(速いがデータ喪失リスクあり、結果整合性)、コンセンサスベース(Raft等のクオラム)があります。ブロックチェーンは非同期式P2Pレプリケーションを使用します。

❓ よくある質問

Why do databases use data replication?

To prevent data loss if a server crashes (fault tolerance), and to allow more people to read the data simultaneously without overloading a single server.

What is the difference between synchronous and asynchronous replication?

Synchronous replication makes sure every copy is updated before finishing a task (slower but safer). Asynchronous replication finishes the task immediately and updates the copies in the background (faster, but risks data loss if it crashes before syncing).

Is a blockchain a replicated database?

Yes. A blockchain is a decentralized, peer-to-peer replicated database. Every full node on the network holds a complete, identical copy of the entire transaction history.

📚 出典