[erlang-questions] Architectural quandaries

Jay Nelson jay@REDACTED
Mon Sep 15 22:00:18 CEST 2014


David N. Welton wrote:

> So you would advocate putting everything in one Erlang ‘application'
> in order to take advantage of the restart capabilities such as
> rest_for_one?  I was actually moving to break things up into separate
> applications with different git trees and everything, so that things
> could be developed in a more independent way: for instance, the report
> generation software gets its own application, separate from the
> hardware control software.

Don’t confuse development with operations. If you like, you can make
separate applications in separate github repos. That may make it easier
to test each component. I would do that and have separate PropEr
test suites run by common_test for each one (that’s my current style).

It means managing separate repos, but if the components are generally
useful, it makes it convenient for others.

In operations I would have one application that uses included_applications and
starts the root supervisor of each of your other components in the correct
dependency and startup sequence. Especially if you are writing all the
components, you will be intimately familiar with the dependencies and
start up behaviour of each one. Of course, this overlord application is the
real application you started talking about and would be a separate repo
of its own.

If you have several applications, rather than using included_applications,
you will have the possibility of a component failure which is undetected
and will not restart without manually restarting or writing your own code
to monitor and manage them.

> I was starting to think along the lines of a centralized system for
> monitoring some of these applications...

Hmm. I prefer to use the OTP tools that are present, and use them to my
benefit to avoid such circumstances. Splitting into independent applications
defeats all the restart facilities of OTP, unless you use heart and make
them all permanent applications and are willing to wait for VM restarts
when things start to go sideways…

jay




More information about the erlang-questions mailing list