szajbus

szajbus

Pogo is a distributed supervisor for clustered Elixir applications.

It uses battle-tested distributed named process groups (:pg) under the hood to maintain cluster-wide state and coordinate work between local supervisors running on different nodes.

Features of distributed supervisor:

  • automatically chooses a node to locally supervise child process
  • a child process running in the cluster can be started or stopped using any local supervisor
  • ensures a child is started only once in the cluster (as long as its child spec is unique)
  • redistributes children when cluster topology changes

In that aspect it’s similar to Horde or Swarm, but doesn’t provide a distributed registry (Horde and Swarm do). Internals obviously are different - Horde uses ∂-CRDT, Swarm uses Interval Tree Clock for synchronization. Pogo’s local supervisors don’t exchange messages to synchronize state, but rely on Erlang’s process groups, observe their memberships and adjust their local state based on it.

For anyone interested, Pogo’s inner workings have been detailed in an introductory blog post :writing_hand:.

To provide some context, the library was developed at Telnyx as an alternative to Horde as we couldn’t overcome some problems that TBH could have been peculiar to our environment (20+ node cluster with quite dynamic membership). Not that it went smoothly :slight_smile: but since version 0.3 it’s been quite stable.

https://github.com/team-telnyx/pogo

Showing Posts 1 to 9

hst337

hst337

Thanks for this cool library!

I have several questions:

Does is mean that in case of network split, there will be two instances of the same child_spec: one in the part of network, which is not connected to the leader, and one which is a process, restarted by the topology change? Or will the disconnected from the leader part of the cluster just kill all local children?

szajbus

szajbus OP

In case of a network split there will be two instances of each child process as there is no concept of a leader or majority in pogo. Once the connectivity is restored, extraneous instances will get terminated.

jaybe78

jaybe78

Hello,

Could you please tell the status of the lib ? still actively maintained ?
Has it been thoroughly tested in production apps ?

I’m looking for distributed libs to globalize genserver across cluster nodes.

I was going to use Horde but unfortunately the maintainer does not fix issues anymore. (I don’t blame him for it).
Swarm seems to have been abandoned.

It seems there’s not so many options left…

slouchpie

slouchpie

Have you looked at :process_hub?

jaybe78

jaybe78

It’s in alpha stage. I’m hesitant to use it for a production app.

Have you used it ?

slouchpie

slouchpie

Only for small-scale projects.

jaybe78

jaybe78

Did you encounter any issues ?

slouchpie

slouchpie

I only encountered 1 issue, and I fixed it here: Fix `stop_child` when using string IDs for the children by peaceful-james · Pull Request #1 · alfetahe/process-hub · GitHub

Just follow your gut and pick whichever library feels right to you. Whatever you choose, I think you will have to at some point read the source code to understand what is happening.

I have used :pogo and :horde a lot. :pogo is easy to understand. The source code was only a couple of files when I was using it. :horde was difficult for me to understand and in a production project we kept seeing it just “losing” visibility of nodes randomly. That was probably our own ignorant fault. However, I have found :process_hub to be reliable and easier to understand. The source code is clear enough that I am able to feel “in control” because I understand, in broad strokes, what is happening.

You did not ask but here is info on how I run distributed nodes locally with docker: Using :dns_cluster with docker-compose locally (it can be done) When I wrote this I was using :pogo because I was trying to replace :horde. The same approach works for :process_hub.

This is just my subjective opinion based on my experience. For me, the most important factor when choosing a lib is how responsive and active are the authors of the library. I don’t care if there are 1000 github issues so long as the maintainers are responding to people.

szajbus

szajbus OP

Pogo is intentionally small, doesn’t include distributed supervisor for example as Horde does, but its maintenance surface is really small.

After fixing some initial issues that we had with it at Telnyx, it’s been succesfully running in production for more than a year now.

It’s been used in several projects, the largest one had a cluster of about 30 elixir nodes distributed globally. Pogo was doing fine there.

— All posts loaded —

Where Next? Top

Trending in Announcing Top

bluzky
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
387 15136 120
New
wojtekmach
Hey everyone! Req is an HTTP client for Elixir that I’ve been working on for quite some time. There is already a lot of HTTP clients out...
New
handnot2
Samly can be used to enable SAML 2.0 Single Sign On in a Plug/Phoenix application. This library uses Erlang esaml to provide plug enabl...
New
woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
restlessronin
The repo is at GitHub - cyberchitta/openai_ex: Community maintained Elixir library for OpenAI API · GitHub. Docs are at OpenaiEx User Gu...
152 11030 135
New
shahryarjb
The Chelekom project is a library of Phoenix and LiveView components generated via Mix tasks to fit developer needs seamlessly. One of i...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New

Other Trending Topics Top

mudasobwa
I am seeing a lot of aplications of Argumentum ad Vericundiam in software discussions. They do link some piece of writing and point us to...
New
bartblast
Hey folks, I just published a post about Hologram’s funding and where the project goes next - the short version: Curiosum as Main Spons...
New
alexslade
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog It says that Fly is going all-in on sprites, which is a worry ...
New
Herve37
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using. We’re particularly inte...
New
sorenone
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
New
lawik
I was thinking since Goatmire Elixir turned out pretty good I should maybe do another one. 30th of Sep - 2nd of Oct this year./ The firs...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews