Company
Date Published
Author
Filipe Cabaço
Word count
693
Language
English
Hacker News points
None

Summary

Elixir's libcluster provides a powerful feature that allows multiple nodes to communicate between them without extra services in the middle, reducing overall system complexity. However, connecting servers can be challenging due to name discovery. To address this, Supabase has released its approach by open-sourcing libcluster Postgres Strategy. This strategy uses Postgres' event system to facilitate connection and communication between Elixir nodes. By utilizing Postgres, Supabase aims to be cloud-agnostic and accessible for self-hosting options. The strategy involves sending a NOTIFY message to a channel with the node's address, listening for new messages, and connecting to the node received in the payload. A heartbeat is also configured to enable libcluster to heal the cluster if needed.