stefanolaru / aws-cloudformation-templates

A collection of AWS CloudFormation templates
3 stars 3 forks source link

Stop early if less than 3 nodes #3

Open alexw23 opened 3 months ago

alexw23 commented 3 months ago

Just reaching out as I've been using your templates, thank you for creating these!

If you have a spare moment can you explain why you set the minimum nodes to 3 in the instance updater?

https://github.com/stefanolaru/aws-cloudformation-templates/blob/8a248408b54ee212c058d7158afff5d32a3a218f/typesense-multi-node/functions/instance-listener/index.js#L23

Is there any issue in updating the nodes when it's less than 3?

stefanolaru commented 2 months ago

Hi Alex,

Typesense uses the Raft consensus algorithm to manage the cluster and recover from node failures. As Raft requires a quorum for consensus we need to run a minimum of 3 nodes to tolerate a 1-node failure.

I wrote a bit more in-depth about it here: https://blog.stefanolaru.com/how-to-run-highly-available-typesense-cluster-in-aws#heading-how-it-works