[erlang-questions] Erlang in a WAN

zxq9 <>
Fri Mar 25 13:32:28 CET 2016


On 2016年3月25日 金曜日 13:19:37 you wrote:
> >
> > term_binary/1 <-> binary_term/1 over TLS.
> >
> > And that's about the whole story.
> 
> 
> Well that's one part of it. :)
> 
> We are using Syn in a distributed environment, so that's how we know which
> messages need to be routed to which processes.
> If we were to not use standard Erlang, then it would make things way more
> complicated: how would we know how to route a request then?

This becomes a questions about how you have the system itself broken up
into partitions.

Typically the moment you say "WAN" I say "the socket is the border of the
system's visibility". That is your new design constraint.

If you are currently relying on the idea that everything has a Pid and
you can just flip it a message then with a partitioned system you now
need to determine *why* process A is foreign relative to process B. If
you can determine why that is so you can discover design rules for
partitioning the system into two clusters, and at that point the matter
of how two processes within a cluster, two processes in two different
clusters, or the clusters themselves should interact becomes (in my
experience so far) pretty obvious. Its that first step, going from a
single mesh of "everything is a Pid or registered name" to "this is now
two independent systems" that is the hard step mentally.

Most of the time what you find is there are a few places fairly high in
the message graph where things split and don't need to interact very
closely, or if they do it is either rare, or indirect (usually via some
common data store which itself can be conceptually split out as a
separate service).

So far I haven't had a case in business, chat or game software where this
constraint didn't actually lead to cleaner architecture, but on two
occasions it *has* led to a bit of extra work cleaning things up that had
previously been considered very low-priority refactoring.

Hopefully I expressed that without too many typos or skipping much.
I'm in a bit of a rush.

-Craig


More information about the erlang-questions mailing list