[erlang-questions] Structure of a *scalable* application?
Chris Pacejo
colanderman@REDACTED
Sat Aug 23 05:42:35 CEST 2014
On Fri, Aug 22, 2014 at 1:34 PM, Chris Pacejo <colanderman@REDACTED> wrote:
> On Fri, Aug 22, 2014 at 12:24 PM, Michael Loftis <mloftis@REDACTED> wrote:
>> Most erlang applications are designed to run an instance per node of the
>> application module, they then RPC to other instances as necessary (see
>> mnesia). I can't think of any offhand where a single application
>> instance runs across multiple nodes but I'm sure it exists.
>
> OK, this makes sense.
However, I must wonder -- what of a system for which some portions
should be replicated, but others should not? e.g. consider a system
which consists of:
* workers, which should run on all nodes;
* gateways, which should run only on Internet-connected nodes; and
* a database, which should run on exactly one node.
Should these functions each be separate applications, with multiple
instances of each as appropriate? (And a distributed application in
the case of the database?)
Should they be a single application instantiated on all nodes, with
leader election to determine which node owns the database, and with
the gateways idle on non-Internet-connected nodes?
Should they be a single (distributed) application with a single
instance, which distributes work using rpc?
I would lean towards the first option, but I'm hesitant to create so
many micro-applications.
More information about the erlang-questions
mailing list