Implementation of the Raft Consensus Algorithm Based on the Coroutine Mechanism and a Specialized Network Library
Abstract
This paper discusses the implementation of the Raft Server consensus module in the C++ standard 20 programming language. The key feature of the work is that the algorithm is implemented without the use of third-party libraries. This approach guarantees flexibility and provides the opportunity to emphasize on maximizing performance. First, an overview of the Raft algorithm is presented, followed by details of the Raft Server development process, and a description of the proprietary network library based on the coroutine mechanism is presented. The implementation of the algorithm utilizes the features of C++ standard 20, in particular coroutines, to present an efficient and modern methodology for creating critical components of distributed systems. This study not only demonstrates the practical applications and benefits of C++20 coroutines in complex distributed software environments, but also analyzes the emerging problems and their solutions when developing a consensus module such as Raft Server.

This work is licensed under a Creative Commons Attribution 4.0 International License.
Publication policy of the journal is based on traditional ethical principles of the Russian scientific periodicals and is built in terms of ethical norms of editors and publishers work stated in Code of Conduct and Best Practice Guidelines for Journal Editors and Code of Conduct for Journal Publishers, developed by the Committee on Publication Ethics (COPE). In the course of publishing editorial board of the journal is led by international rules for copyright protection, statutory regulations of the Russian Federation as well as international standards of publishing.
Authors publishing articles in this journal agree to the following: They retain copyright and grant the journal right of first publication of the work, which is automatically licensed under the Creative Commons Attribution License (CC BY license). Users can use, reuse and build upon the material published in this journal provided that such uses are fully attributed.