DISTRIBUTED STATE MACHINE REPLICATION

 

Step-1

Place copies of the state machine on multiple independent servers.

 

·         now in a typical distributed architecture, the distributed state machine replication mechanism works in this way

·         so you have multiple servers which work in a distributed fashion so the advantage of using distributed servers in place of a centralized server that we discussed earlier 

·         so the idea is that first, you have multiple servers here

·         so you place the copies of the state machine on each of the servers so each of the servers has a copy of this interstate machine.

Step-2:

Receive client requests, as an input to the state machine.

 

·         then servers get that client request so here it is like that Bob is submitting his request and Alice submitting her request

·         then the request goes to different servers

·         now when the requests are going to the different servers so if you execute the state independently at its server the state that will be there in left server and the state that will be there in the right server

·         they may be different so here you will reach to a state that Bob has transferred the money

·         here you have reached the state that Alice has transferred the money but collectively you have to ensure that all the three server reaches to a state

·         after a certain time that both Bob and Alice have transferred their share of the money so to achieve this the state machine replication mechanism works in this principle 

Step-3:

Propagate the inputs to all the servers.

 

·         you propagate these inputs to all the servers so all the servers as the input like that Bob has transferred the money and Alice has transferred the money


 

Step-4:

Order the input based on some ordering algorithm.

 

·         then you order the inputs based on a certain ordering algorithm

·         you can have an associated timestamp with every individual transaction whenever bob is making his transaction it is associated with a timestamp and

·         when Alice is transferring her share of the money that particular transaction is associated with another timestamp

·         so based on that timestamp you can have an ordering of the transactions and then once this order is done

·         then every individual system they execute the inputs based on the orders which have been decided and they execute it individually at each server

·         now once this information is executed in each server in that particular ordering algorithm then you know that well first the transaction corresponds to Bob that will get executed in the transition corresponds to Alice that will get executed and

·         all the server’s reaching to the same state that both Bob and Alice have transferred their share of the money 

Step-5:

 

Sync the state machines across the servers, to avoid any failure.

 

·         so once these transactions are done

·         then sync the state machines across all the servers to avoid any failure

·         it may happen that the left server during the execution it has failed and after some time it recovers

·         so once it recovers it should get this updated state that will both Bob and Alice has transferred their share of the money

·         so that update is done through synchronization of the state machine nowhere in this entire algorithm 


 

Step-6:

if output state is produced, inform the clients about the output.

 

·         we have certain outputs that can be produced like it may happen that well the output is when both the share of the money has been transferred you send the output or you notified that client that well the job is now ready to get executed so that particular output is sent from the server to the individual users now in this entire procedure there are two glitches the first one is that you need to maintain an ordering service and the second is that in the presence of failure you need to ensure that all the individual servers are in the same page everyone knows that well Bob bought both the transactions from Bob and Alice they got executed and the inter money has been transferred