[erlang-questions] Dependencies, included applications and supervision

Dmitry Kolesnikov dmkolesnikov@REDACTED
Wed Jun 25 20:39:06 CEST 2014


Hello Federico,

I would agree with you here. Personally, I think the trick with included applications complicates design and dependencies management. Here is my view on the problem of “dependency supervision”:

A dependent application provides variour resource to parent application. Those resources are either provided using start_link semantic or open/close paradigm (e.g. sockets). The start_link dependencies are manageable using supervisor tree of parent application. For example, you application uses cache, it instantiates cache bucket using start_link within root superior. The death & recovery of cache instance is handled by root supervisor of “parent” application. The second case is manageable in similar fashion with an exception that you have a client process that open/close and uses resource service. The failure of resource is propagated to client and it’s top supervisor. I do not see any reason why you need to implement extra supervision layer for these applications.

On another hand, you solution might be composed of sibling application, each is responsible for own subsystem. The concept of permanent applications and heart solves the problem of system recovery to consistent state. The failure or permanent application triggers VM failure and concequent recovery by heart application. My usual design of supevisor trees leads the application termination as ultimate, last resort recovery solution. My solutions are composed of multiple interchangeable nodes, the temporary loss of node is transparent to clients. 

The usage of this model does not require any explicit supervision of application by it self.    
 
    
Best Regards, 
Dmitry



On 25 Jun 2014, at 20:48, Federico Carrone <federico.carrone@REDACTED> wrote:

> We have been having a long discussion the previous months about included applications and supervision at our workspace.
> 
> Some of us just lists the needed applications in the .app file and make sure that all necessary application are started when our application starts. 
> 
> For some teammates this has a big issue that: if a depencendy dies, our application's supervision tree will not know about it. They say that the system would be in an inconsistent state. So what they do is that they add the applications inside the included applications and they start the top level supervisor of each dependency inside our application supervisor tree.
> 
> I do not really like this since I think that each application should be separate.
> 
> I would REALLY like to know the community views and experiencies on this.
> 
> Thanks in advance,
> Federico Carrone.
> 
> -- 
> http://federicocarrone.com/
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140625/a3f9a032/attachment.htm>


More information about the erlang-questions mailing list