SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.
SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.
Successfully reported this slideshow.
Activate your 14 day free trial to unlock unlimited reading.
Magic Clusters and Where to Find Them 2.0 - Eugene Pirogov
91.
Easy clustering, registration, and
distribution of worker processes for
Erlang/Elixir
92.
…a simple case where workers are
dynamically created in response to
some events under a supervisor, and
we want them to be distributed across
the cluster and be discoverable by
name from anywhere in the cluster
111.
iex(node1@127.0.0.1)6> :mnesia.info()
---> Processes holding locks <---
---> Processes waiting for locks <---
---> Participant transactions <---
---> Coordinator transactions <---
---> Uncertain transactions <---
---> Active tables <---
books : with 0 records occupying 304 words of mem
schema : with 2 records occupying 566 words of mem
===> System info in version "4.14.1", debug level = none <===
opt_disc. Directory "/Users/gmile/Mnesia.node1@127.0.0.1" is used.
use fallback at restart = false
running db nodes = ['node3@127.0.0.1','node2@127.0.0.1','node1@127.0.0.1']
stopped db nodes = []
master node tables = []
remote = []
ram_copies = []
disc_copies = [books,schema]
disc_only_copies = []
[{'node1@127.0.0.1',disc_copies},
{'node2@127.0.0.1',ram_copies},
{'node3@127.0.0.1',ram_copies}] = [schema,books]
12 transactions committed, 0 aborted, 0 restarted, 10 logged to disc
0 held locks, 0 in queue; 0 local transactions, 0 remote
0 transactions waits for other nodes: []
:ok
iex(node1@127.0.0.1)32>
112.
iex(node1@127.0.0.1)6> :mnesia.info()
---> Processes holding locks <---
---> Processes waiting for locks <---
---> Participant transactions <---
---> Coordinator transactions <---
---> Uncertain transactions <---
---> Active tables <---
books : with 0 records occupying 304 words of mem
schema : with 2 records occupying 566 words of mem
===> System info in version "4.14.1", debug level = none <===
opt_disc. Directory "/Users/gmile/Mnesia.node1@127.0.0.1" is used.
use fallback at restart = false
running db nodes = ['node3@127.0.0.1','node2@127.0.0.1','node1@127.0.0.1']
stopped db nodes = []
master node tables = []
remote = []
ram_copies = []
disc_copies = [books,schema]
disc_only_copies = []
[{'node1@127.0.0.1',disc_copies},
{'node2@127.0.0.1',ram_copies},
{'node3@127.0.0.1',ram_copies}] = [schema,books]
12 transactions committed, 0 aborted, 0 restarted, 10 logged to disc
0 held locks, 0 in queue; 0 local transactions, 0 remote
0 transactions waits for other nodes: []
:ok
iex(node1@127.0.0.1)32>
“schema” + “books” tables exist
on 3 different nodes
3 nodes are running
current node (node1)
keeps 2 tables as RAM + disk
123.
If in your cluster the network
connection between two nodes
goes bad, then each one
will think that the other node is down,
and continue to write data.
Recovery from this is complicated.
125.
“…measures are taken such
that network reliability is very high”
126.
“…In such a highly specialized
environment, the reliability of the control
backplane essentially removes some of
the worries which the CAP theorem
introduces.”