mirror https://github.com/ostinelli/syn

Roberto Ostinelli eb70ad8422 Improve logging for node down. 5 лет назад
src eb70ad8422 Improve logging for node down. 5 лет назад
test 27aa89378b Monitor only processes on own node. 5 лет назад
.gitignore 26d9321ec1 Switch to rebar3. 9 лет назад
.travis.yml 0f43dadaf1 Update travis.yml. 7 лет назад
LICENSE.md 60d8425bff Start adding registry with no mnesia sync mechanisms. 5 лет назад
Makefile 60d8425bff Start adding registry with no mnesia sync mechanisms. 5 лет назад
README.md 60d8425bff Start adding registry with no mnesia sync mechanisms. 5 лет назад
rebar.config 60d8425bff Start adding registry with no mnesia sync mechanisms. 5 лет назад
rebar.lock 60d8425bff Start adding registry with no mnesia sync mechanisms. 5 лет назад

README.md

Build Status Hex pm

Syn

Syn (short for synonym) is a global Process Registry and Process Group manager for Erlang.

Introduction

What is a Process Registry?

A global Process Registry allows registering a process on all the nodes of a cluster with a single Key. Consider this the process equivalent of a DNS server: in the same way you can retrieve an IP address from a domain name, you can retrieve a process from its Key.

Typical Use Case: registering on a system a process that handles a physical device (using its serial number).

What is a Process Group?

A global Process Group is a named group which contains many processes, possibly running on different nodes. With the group Name, you can retrieve on any cluster node the list of these processes, or publish a message to all of them. This mechanism allows for Publish / Subscribe patterns.

Typical Use Case: a chatroom.

What is Syn?

Syn is a Process Registry and Process Group manager that has the following features:

  • Global Process Registry (i.e. a process is uniquely identified with a Key across all the nodes of a cluster).
  • Global Process Group manager (i.e. a group is uniquely identified with a Name across all the nodes of a cluster).
  • Any term can be used as Key and Name.
  • A message can be published to all members of a Process Group (PubSub mechanism).
  • Fast writes.
  • Automatically handles conflict resolution (such as net splits).
  • Configurable callbacks.
  • Processes are automatically monitored and removed from the Process Registry and Process Groups if they die.

Notes

In any distributed system you are faced with a consistency challenge, which is often resolved by having one master arbiter performing all write operations (chosen with a mechanism of leader election), or through atomic transactions.

Syn was born for applications of the IoT field. In this context, Keys used to identify a process are often the physical object's unique identifier (for instance, its serial or MAC address), and are therefore already defined and unique before hitting the system. The consistency challenge is less of a problem in this case, since the likelihood of concurrent incoming requests that would register processes with the same Key is extremely low and, in most cases, acceptable.

In addition, write speeds were a determining factor in the architecture of Syn.

Therefore, Availability has been chosen over Consistency and Syn is eventually consistent.