[erlang-questions] Recommended Application Structure
Sun Oct 23 19:59:33 CEST 2011
I've often wondered what is the correct (as in idiomatic Erlang) way to structure an sufficiently complex service in Erlang?
Obviously a simple service would be a single application, with a supervisor hierarchy something like:
Let's suppose you have a complex service to deploy (that does related, but functionally separate tasks), what is normal:
1) Separating the complexity as multiple apps (i.e. 2 .app files and beam files in separate ebin directories):
2) A single app with multiple (hierarchical) supervisors (i.e. 1 .app file, all beam files in the same ebin directory):
Seems like the preference is towards example 2; but to me this means that you can't easily decompose and separate functionality apart. It also means that messaging can jump across supervisors making for somewhat messy interfaces (plus having to cross supervise/link gen_servers that are separated by different supervisors).
More information about the erlang-questions