Part of master-slave replication protocol:
- Master sends append data to slaves
- After got reply from slaves, Master needs to send COMMIT to slaves and wait for commit done
boost::asio is tried for #2 step, using sync write and read. Master write a short commit message to slaves, and slaves read and write a reply. After master receives majority of the replies, commit is done and send OK to client.
The goal is to make the #2 step as fast as it can be. The message are short and I want the latency low and requests per second high. Any advice on how to achieve this?