STUDIA UNIV. BABES¸–BOLYAI, INFORMATICA, Volume LXV, Number 2, 2020 DOI: 10.24193/subbi.2020.2.05 LOG REPLICATION IN RAFT VS KAFKA MANUELA PETRESCU AND R ˘ AZVAN PETRESCU Abstract. The implementation of a fault-tolerant system requires some type of consensus algorithm for correct operation. From Paxos to View- stamped Replication and Raft multiple algorithms have been developed to handle this problem. This paper presents and compares the Raft algorithm and Apache Kafka, a distributed messaging system which, although at a higher level, implements many concepts present in Raft (strong leadership, append-only log, log compaction, etc.). This shows that mechanisms conceived to handle one class of problems (consensus algorithms) are very useful to handle a larger category in the context of distributed systems. 1. INTRODUCTION Due to the increased volumes and fault tolerance requested by the real- life applications, new methods emerged to implement replicated servicers and coordination client interaction with server replicas. From Paxos algorithm, to Raft and Kafka, many applications use different models in order to provide solutions for these requirements. This paper is analyzing differences and similarities between Raft consensus algorithm and Kafka methods and consensus. Why Raft and why Kafka? Raft is a consensus algorithm that was created as an alternative to Paxos algorithm, comparable with it in terms of fault tolerance and performance, having a different structure allowing it to be easier to understand and to implement. For both of them (Kafka and Raft), logs play an essential role. Kafka is a distributed software platform originally developed by Linked, based on log replication that allows client processes to publish and consume data. It is an alternative to the traditional queues-based messages systems (ActiveMQ). Received by the editors: 25 September 2020. 2010 Mathematics Subject Classification. 68U99. 1998 CR Categories and Descriptors. C.2.4 [Computer Communication Systems]: Distributed Systems – Distributed applications . Key words and phrases. comparison, Raft, Kafka, consensus algorithm, replicated log. 66