Why interact with the world at the core level at all? Push those decisions out as far as humanly possible and wind the functional “units of work” and see if you can remove as many “real world interactions” with the outside world. As an example, rather than do a bunch of queries, perhaps model your program such that it returns a data structure with a plan to run that query. as in e.g. Ecto.Multi. This may not be appropriate for your use case, but you can expand the line of thinking to your own domain.
I think the concerns about not using a process and mailboxes are out the window given you’re on the BEAM =)
As an aside, in general, lean towards more data structures and fewer functions wherever possible. It helps you maintain program agility as it gets larger.






















