William Cummings
William Cummings

Reputation: 21

Mnesia process registry best practices

I'm implementing a "process registry" in Erlang (single node), so I can lookup users processes based on a variety of fields/criteria. The processes will asynchronously update the mnesia ram database by casting to a server process which manages the table. The server process will also monitor the processes so entries can be removed if a process dies unexpectedly.

Does this make sense? Is putting the ref in the tuple key for each of my registry tables the best approach? I assume this pattern is relatively common, how do people generally accomplish this (please don't say gproc)?

Upvotes: 1

Views: 285

Answers (2)

Sergey Loguntsov
Sergey Loguntsov

Reputation: 68

Gproc doesn't allow increase erlang cluster. it should be restarted when you add new machine.

You can use syn for same purpose: https://github.com/ostinelli/syn It's mnesia based process registry with some limits. It can't keep one pid for several names (unfortunately)

Upvotes: 1

Peer Stritzinger
Peer Stritzinger

Reputation: 8372

In theory it makes a lot of sense. Many programs need something like this.

In practice you should just use gproc in local mode and not reinvent the wheel.

Upvotes: 0

Related Questions