josevalim
Hello everyone,
I would like to propose the addition of the Registry project to Elixir:
https://github.com/elixir-lang/registry
The Registry project is a local and scalable key-value process storage in Elixir. It encapsulates 3 known use cases:
- Process registry: to register process with dynamic names. Often Elixir developers need to rely on gproc or other tools.
- Code dispatching: dispatch a module/function associated to a given key
- PubSub implementation: send messages to local processes registered under a given topic
There are probably other use cases waiting to be discovered. ![]()
You can learn more in the documentation:
http://elixir-lang.org/docs/registry/
The project clocks only 700LOC with documentation and performs well. We have extracted, improved and generalized the patterns from Phoenix.PubSub, the implementation used to manage and publish messages to 2 million subscribers.
When benchmarking thousands of processes registering serially, it is twice slower than local atoms, albeit 33% faster than gproc. On concurrent cases, it distributes well across all cores, becoming only 15% slower than local atoms, and 3x faster than gproc on a machine with two cores (gproc seems to be serial with its default configurations so the difference will be even bigger on more cores).
Please give it a try and let us know what you think.
Trending in News
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #elixirconf-eu
- #metaprogramming
- #hex











Showing Posts 34 to 25- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
tompave
Thank you both, that was very helpful!
gon782
There is a talk about the DHT plans here:
dom
The project was briefly mentioned at the conference in Stockholm last year:
It’s the distributed hash table mentioned as an alternative to Global on the last slide of “News from the OTP team.
There was also this tidbit:
http://www.erlang-factory.com/sfbay2017/christopher-meiklejohn.html
That’s about all I’ve heard personally.
tompave
Doesn’t
globalpredate the ElixirRegistryand this whole thread by years? I think that @josevalim was referring to something else. Still, I couldn’t see reference to any new work in progress in the global docs.NobbZ
Perhaps in the documentation of the
globalmoduletompave
Does anyone know where can I find more info on the OTP Team’s plans on a distributed registry?
josevalim
Because the name is not optional on this case.
No conventions as far as I know.
eidge
Hey José,
I was taking a look at the code and was puzzled over two things:
Is there a convention in place for cases like this?
josevalim
The Registry has been merged into Elixir master.
josevalim
Yes but it doesn’t mean having a partition per core is necessarily the way to go. If you don’t expect an intensive workload, using 4 or 8 partitions for 40 cores would be fine.
Being the most pessimistic, I would do a factor of 0.25 on the number of cores. So for 40 cores, I would do 10 partitions. Like this:
System.schedulers_online |> div(4) |> max(1).