daviaws

daviaws

Is Horde Registry really distributed?

I was trying to address a distributed genserver, which is ensured to be unique by the Horde.DynamicSupervisor supervision tree.
I can check this with Supervisor.which_children - showing me local and remote pids.

  • I can derive recursively which_children to child supervisors of Horde and so address process remotelly.

But the Register should also do it.
“A distributed process registry.”
“Local changes to the registry will automatically be synced to other nodes in the cluster.”

But reading the code of register/lookup
https://github.com/derekkraan/horde/blob/master/lib/horde/registry.ex#L222-L230
It’s working over :ets.
Not only this but I can use Horde.Registry to register the same key over 3 nodes.

image
image

Not only this. For each node, Horde.Registry shows me different local pids.
Both Horde.DynamicSupervisor, and Horde.Registry on my application children list.

Am I missing something? Because :ets is a local resource. And even if the Registry is said to be distributed and it sure have deltacrdt configured on start.
I could not validate distributed behavior.

Most Liked

derekkraan

derekkraan

Hello, I’m the author and sole maintainer of Horde.

Just popping in to answer a few of your questions:

Is Horde Registry really distributed?

Yes, it is backed by DeltaCRDT, which has leaderless syncing. Updates that come in are written to an ets table for quick read access. Writes go through the CRDT.

Am I missing something?

It looks like you have configured Horde.NodeListener for your Horde.DynamicSupervisor, but not for your Horde.Registry. I checked, and the guides are not super clear on this, probably owing to the order in which things were built (Horde.NodeListener was added after the guides were written).

Others have mentioned this already, perhaps you should re-read their responses.

Unmaintained

Horde is a library that, as I have learned, has some limitations, but still remains useful to quite a few people (>9k downloads last 7 days). I don’t have the time nor the interest in large development efforts for the project, and there are not a lot of new PRs coming in to the project.

I try to stay on top of things, but the obvious bugs have been ironed out a long time ago, and aside from a few small issues, I would say that Horde is doing fine.

Finally, I will note that Horde is provided free of charge and without any kind of guarantee that it will work.

adw632

adw632

You may be referring to the old slow pg that pg2 replaced.

The docs for the ‘new’ pg in OTP/23 that deprecated pg2 explicitly states that pg is eventually consistent. The source code for pg indicates it was contributed by WhatsApp.

pg doesn’t have a long list of critical crashing problems unlike some other options mentioned here.

In theory, theory and practice are the same. In practice they are not.

anuaralfetahe

anuaralfetahe

I have been working on a comparable library ProcessHub. Although it’s still in the alpha stage, active development is ongoing.
I’m not going to mention the other libraries already pointed out but alternatively, you may want to explore Swarm.

While you could develop your implementation using the pg module, which is robust and would perform well in your described scenario, you may encounter challenges when the distribution model becomes more complex.

Where Next?

Popular in Questions Top

sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
nobody
How to bind a phoenix app to a specific ip address? could not find anything about that, nowhere, unfortunately, but for me this is quite...
New
jaysoifer
Is there a way to rollback a specific migration and only that one (“skipping” all the other ones)? Would mix ecto.rollback -v 200809061...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> somethi...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
marick
I had some trouble figuring out how to make many-to-many associations work. Once I got it working, I wrote a blog post. Because I’m a nov...
New

Other popular topics Top

gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 52341 488
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New

We're in Beta

About us Mission Statement