In the previous article I showed how to create a write-once distributed switch. However in real life we usually want to mutate state. So Let’s fix it and design a distributed variable.
There was variable's pseudocode but later I realised that single degree Paxos can be used as state machine itself. When I did it I saw that there is almost no difference between ditributed switch, variable or even CAS-guarded variable. Please read the A memo on how Paxos works post to understand it and to get information on how to build them.