Question

I am building an Erlang/OTP system which consists of a MochiWeb web server, some custom Erlang/OTP applications and a few non-native components, which are the following:

  • a CouchDB database to store both the state of the MochiWeb web server and the persistent data (users, accounts, etc.)
  • a legacy PostgreSQL database to store some other entities (orders, accounts, etc; client's requrement: can not be migrated to CouchDB, the data should be used as is);
  • an Asterisk server to provide phone notifications to the users of the system.

I would like to achieve a high level of uptime and availability and thus I would like to know what is the best way to monitor those non-Erlang/OTP elements of the system. Basically, I would like to have each element of the system to be supervised, monitored and restarted if needed. It is easy achieveable for Erlang/OTP applications, but I don't know how to do that with non-Erlang components.


Should I wrap them as Erlang/OTP applications and include into the OTP supervision tree?

Or should I use some third-party software tools to monitor and supervise those non-Erlang/OTP components of the Erlang/OTP system?

What is the best known practice to do that?

Was it helpful?

Solution

The answer is it depends :P

I have seen both methods used, but I am not too sure if one has advantages over the other. My gut feeling would be to pick the one where you manage the application through a port from within erlang. That way, you have a nice centralized way of knowing if problems crop up, and can fix things easily.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top