tags:

views:

164

answers:

3

I want to run multiple Erlang applications, one being Riak and another being a web server. Should I run them in the same of separate Erlang VMs and why?

+3  A: 

If they don't have to do anything with each other: No. You might need to restart the VM for one of the applications, which would result in a downtime for both.

ZeissS
I thought the Erlang VM didn't go down?
Zubair
A reason for a restart is to modify a VM option. You cannot do that without restarting. Further: In this case a failover could take place, so the app is not down, just one node. :D
ZeissS
Upgrading to a newer Erlang VM version also needs a restart.
Zed
+1  A: 

It is called "fate sharing", a common design decision. The more sub-systems share common resources, the more their "fate" are tied together. In the event of malfunction/failure, the more "fate sharing" --> the increased likelihood of systematic failure.

IF you can have each in separate VMs then I would say it is better this way.

jldupont
Doesn't this imply that I should run all my server processes in a separate VM ? :)
Zed
@zed: that's not exactly what this means (notice the "IF" in capital letter). There is **always** a SPOF (Single Of Failure) lying **somewhere** - it comes down to managing the system for an acceptable level of Availability for a given Cost point. But you knew all that, I know you are just pulling my leg at this point! Cheers.
jldupont
+2  A: 

While many would recommend decoupling these subsystems I would take the opposite approach. Erlang has a built in strategy to run many applications on the same release. If your applications talk to each other directly it might make sense for you to bundle them together into a release. This will make calls between the applications faster. Some will argue that all you applications now share the same fate should you need to take the system down for an upgrade that only one of the applications needs. This is a moot point with Erlang where you are distributing your applications across many nodes. Also most upgrades can be done with hot code loading.

Vanson Samuel