As the question said: What benefits brings using the OTP design principles when developing with Erlang?
I am developing a server which will just receive commands and send responses.
As the question said: What benefits brings using the OTP design principles when developing with Erlang?
I am developing a server which will just receive commands and send responses.
OTP is a battle-hardened set of design elements and idioms used in the creation of, as Jonas said, fault-tolerant systems among other things (like flexibility, live updates, etc.). In brief you want to use it for these environments, or environments that may grow into these, because a lot of the blood, sweat and tears of creating reliable, stable systems in Erlang is baked into the OTP behaviours and architecture. If you don't use them you'll either not have a fault-tolerant, flexible system or you'll recreate all of the decisions, one flub and error at a time, to create, in the end, what amounts to a clone of OTP.
So the question really is when don't you want to use OTP? You don't need OTP if you're not doing software that's intended to run for a long time with minimal interruption. You don't need OTP if you already have a framework that does its work that you're more familiar with. You don't need OTP if you want to learn (the hard way, perhaps) what decisions are behind OTP's designs. You don't need OTP if the cost of learning it (and there is a cost there!) exceeds the cost of system downtime for your software.
The best way to become familiar with the whys and wherefores of OTP is the OTP Design Principles User's Guide. Where the reasoning isn't directly stated, you can often read between the lines to discover the rationale for each component.
OTP contains some good design patterns for fault tolerant systems e.g. gen_server and supervising that may be interesting. It depends on what you want to do with Erlang.
E.g. If you want to run a website, you may be interesting to use Yaws and if you want a fault-tolerant website you may be using OTP with Yaws for supervision.
OTP also contains behavior patterns that can be useful.
© 2022 - 2024 — McMap. All rights reserved.