This is an implementation of Chain replication algorithm on the server side.