Data Replication in Distributed System

8,094 views

Published on

Data Replication in
Distributed System

Ehsan hessami

Published in: Technology, Business

Data Replication in Distributed System

  1. 1. Data Replication in<br /> Distributed System<br /> Ehsan Hessami<br />Islamic Azad University Of Qazvin<br />
  2. 2. 2 kind Data Replication<br />1- Synchronous Replication<br />2PC(Two Phase Commit Protocol)Exp: <br />2- Asynchronous Replication<br />1- Primary Site Asynchronous<br />2- Peer-Peer Asynchronous<br />
  3. 3. Primary Site Asynchronous<br />Client<br />Secondary Copy <br />Primary Copy <br />a<br />D<br />b<br />c<br />Update and Read only <br />Translation<br />Lazy Update <br />Propagation<br />Forward Update <br />Transactions<br />
  4. 4. Lazy master Framework<br />Ownership<br />ReplicaCopy<br />1- Primary Copy (denoted by capital Letters)<br />Propagation<br />2- Secondary Copy (denoted by Lowercase Letters)<br />Nodes<br />1- Master Save Primary Copy <br />Refreshment<br />2- Slave Save Secondary Copy<br />3- Master Slave Save Primary & Secondary Copy <br />Configuration<br />Transactions<br />1- Update Transactions (T)<br /> Update Primary Copy<br />2- Refresh Transactions (RT)<br /> Update Secondary Copy<br />3- Queries (Q)<br /> Read Operation From Secondary Copy<br />
  5. 5. Lazy master Framework<br />Ownership<br />Defines<br />When The Update Transaction <br />PrimaryCopy Must be Towards The Nodes Storing its SecondaryCopy<br />Propagation<br />Refreshment<br />Type of Propagation<br />1-immediate<br />Configuration<br />2- deferred<br />
  6. 6. Lazy master Framework<br />Ownership<br />Defines<br />When The Refresh Transaction <br />Must be Start on SecondaryCopy.<br />(immediate , deferred , wait).<br />Propagation<br />Refreshment<br />The Couple Formed by The <br />Propagation And The Trigger Mode <br />1-deferred-immediate<br />Configuration<br />2- immediate-immediate<br />3- immediate-Wait<br />
  7. 7. Lazy master Framework<br />Ownership<br />Defines<br />The Component node of a Replication Schema .<br /> EXP <br />1 Master , n Slave<br />Propagation<br />Refreshment<br />Configuration<br />
  8. 8. System architecture<br />Each Node (Slave & Master) Support DB And 3 Component :<br />1 – Replication Module<br />1-1 – Log Monitor<br />1-2 – Propagator<br />1-3 – Receiver<br />2 – Refresher<br />3 – Network interface<br />
  9. 9. System architecture<br />Log Monitor<br />Propagator<br />Receiver<br />Refresher<br /> Used to extract changes to primary copy From History Log<br /> IF Find Write Operation , write into Input Log for Propagator<br />
  10. 10. System architecture<br />Log Monitor<br />Propagator<br />Receiver<br />Refresher<br />Each Record Have 4 Parameter (Primary ID , Field ID , Operation , New_Value).<br />Propagator have 2 State : immediate , deferred <br />
  11. 11. System architecture<br />Log Monitor<br />Propagator<br />Receiver<br />Refresher<br /> Each Message save in Reception Log<br /> Receiver Read from Reception Log<br />IF we have 1 Master Node then Queue is 1 .<br />
  12. 12. System architecture<br />Log Monitor<br />Propagator<br />Receiver<br />Refresher<br />Checking the Queue for new incoming Record .<br />Refresher is 3 kind : deferred-immediate , Immediate-immediate , Immediate_ wait<br />
  13. 13. Connect and Disconnect<br />Each Connect and Disconnect save in Historylog .<br />ConnectTable Showing the nodes are Connect . <br />Each node Have ConnectTable (Node_id,Replica_id , Status) .<br />< “Connect” , Master_id , Slave_id , Replica_id ><br />< “Disconnect” , Master_id , Slave_id , Replica_id ><br />
  14. 14. Failure & Recovery<br />Slave Failure :<br />All the Connected Master Must Stop Sending Message To it<br />Slave Recovery is Performed in 2 state :<br />1- < “Reconnect” , Master_id , Slave_id , Replica_id , Message_id ><br />2 – Searching in the Reception Log for all messages received from Master_id but not yet Processed by the Refresher .<br />
  15. 15. Failure & Recovery<br />Master Failure : <br />The Slave Receiver a Fail Record :<br />< “Fail” , Master_id ><br />Master Recovery :<br />< “Reconnect” , Master_id , Slave_id , Replica_id , Message_id ><br />* . Message_id is null<br />

×