Socket-Based Distribution
In this section, we will write a simple program using socket-based distribution. As we have seen, distributed Erlang is fine for writing cluster applications where you can trust everybody involved but is less suitable in an open environment where not everyone can be trusted.
The main problem with distributed Erlang is that the client can decide to spawn any process on the server machine. So, to destroy your system, all you’d have to do is evaluate the following:
| | rpc:multicall(nodes(), os, cmd, ["cd /; rm -rf *"]) |
Distributed Erlang is useful in the situation where you own all the machines and want to control all of them from a single machine. But this model of computation is not suited to the situation where ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access