Replikacja Danych (Data Replication)
Przechowywanie identycznych kopii danych na wielu serwerach w celu poprawy dostępności i odporności na awarie.
Blockchainy wykorzystują asynchroniczną replikację P2P, gdzie konflikty rozwiązuje mechanizm konsensusu (np. najdłuższy łańcuch w PoW).
graph LR
Center["Replikacja Danych (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;
🧒 Wyjaśnij jak 5-latkowi
Jeśli masz tajny przepis w jednym zeszycie i go zgubisz, przepis znika. Replikacja to jak rozdanie kserokopii 5 znajomym. Jeśli zeszyt spłonie, znajomi nadal go mają. Ale jeśli zmienisz składnik, musisz obdzwonić wszystkich, by zaktualizowali swoje kopie.
🤓 Expert Deep Dive
Twierdzenie CAP: W przypadku podziału sieci (Partition), system musi wybierać między Spójnością (Consistency) a Dostępnością (Availability). Rodzaje: 1. Synchroniczna (bezpieczna, ale wolna). 2. Asynchroniczna (szybka, ryzyko utraty danych, 'eventual consistency'). 3. Oparta na konsensusie (Paxos, Raft za pomocą kworum).
❓ Częste pytania
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.