Outline: [Article Title]

Keyword: [Enter Targeted Keyword]

Keyword MSV: [Enter Targeted Keyword’s Monthly Search Volume]

Author: [Enter Author Name]

Due Date: [Enter Due Date]

Publish Date: [Enter Desired Publish Date]

User Persona: [Enter Targeted Reader and/or User Persona]


A cluster of Typesense nodes can be run by the user for its high availability. To manage the cluster and recover from node failures, Typesense uses the Raft consensus algorithm.Raft is a consensus algorithm that is intended to be simple to use. In terms of fault-tolerance and performance, it is comparable to Paxos. The difference is that it is divided into relatively independent subproblems and addresses all major components required for practical systems.

What is the Consensus?

Consensus is a critical issue in fault-tolerant distributed systems. Consensus is achieved when multiple servers agree on values. When they come to a decision on a value, it is final. Typical consensus algorithms progress when the majority of their servers are available; for example, a cluster of 5 servers can continue to operate even if two of them fail. If more servers fail, they will be unable to progress. The perfect visualization of the raft algorithm can be found here.So, let’s return to typesense and see how it employs the raft consensus algorithm.

Typesense will automatically replicate data copies to all nodes in the cluster when in cluster mode. Read and write API calls can be sent to any node in the cluster; read API calls are served by the node that receives them, while write API calls are forwarded internally to the cluster’s leader. Because Raft requires a quorum for consensus, one will need at least three nodes to withstand a single node failure. A five-node cluster can withstand up to two node failures, but at the cost of slightly longer write latencies.

High availability in Typesense cloud

When the user toggles the setting ON when launching the cluster, Typesense Cloud manages High Availability for them. As a result, the rest of this section only applies if the user is self-hosting. Typesense

Closing

Typesense was built with several distinctive features primarily aimed at making the developer’s job easier while also giving customer as well as user the ability to provide a better search experience as possible.This article may have been entertaining as well as instructive in terms of how to install typesense from the ground up on a variety of platforms. Join Aviyel’s community to learn more about the open source project, get tips on how to contribute, and join active dev groups.

Call-to-Action

Aviyel is a collaborative platform that assists open source project communities in monetizing and long-term sustainability. To know more visit Aviyel.com and find great blogs and events, just like this one! Sign up now for early access, and don’t forget to follow us on our socials!