When I first used Elixir, I struggled with how to organize my applications. When should I use servers? How do supervisors fit in? Even basic questions such as “how many applications should I write?” made me nervous.
Frankly, I’m still thinking about these questions, three years later, in the same way I’m still thinking about object-oriented system design after 30 years of doing it. But, on the Elixir front, I have come up with an approach that helps me think through these issues.
It isn’t rocket science. I just ask myself these five questions:
What I’m going to show in this chapter is just my ad hoc approach. Please don’t take it as any kind of “methodology.” But if, like me, you sometimes feel overwhelmed when designing a new Elixir system, these steps might help.
Let’s write a simple application to show you what I mean.