News for hackers. Stuff that matters.
Re:Don't start with microservices – monoliths are your friend by andy_ppp on Thursday December 16, 2021 @07:28AM (#29577483)
This is one of the things I love about Elixir and OTP+The Beam that underpin it all. It's really great that you can just slowly (as is sensible) move your system over to message passing across many VMs (and machines) before you need to move to a more bespoke service oriented architecture.

With Umbrella apps this can already be setup from the start and you can break off bits of your app into new distinct message-able components (micro services you could say) as you like while still being able to share code/modules as needed.

The other thing I'd say is you can introspect how these "services" are running in realtime with IEX and it feels like magic being able to run functions in your application like some sort of realtime interactive debugger. One of the biggest issues I had with micro-services is figuring out what the hell is going wrong with them (in dev or prod) without the layers of extra work you need to add in terms of granular logging, service mesh and introspection etc.

Re:Don't start with microservices – monoliths are your friend by jeremyjh on Thursday December 16, 2021 @08:32AM (#29577900)
Creating a lot of actors and messaging for the business logic of your application is considered an anti-pattern in Elixir, and a typical novice mistake. Applications in Elixir are structured using functions that are in modules that call other functions in other modules. Yes you can use OTP applications to isolate dependencies but none of this is done with the intent to more easily break up your app into a bunch of micro-services.
Re:Don't start with microservices – monoliths are your friend by ianbutler on Thursday December 16, 2021 @08:51AM (#29578049)
Right but that's not really what they're saying, they're talking about Umbrella Apps, https://elixirschool.com/en/lessons/advanced/umbrella_projec...

Which is a distinct feature made for breaking up the logic of your applications into smaller, domain bounded libraries. Umbrella apps are for the most part like regular libraries, just internal to the project which let's you do neat things like share config and deployment across them.

They don't require interacting with OTP functionality unless you make them that way and I think the OP was crossing some wires there.

Re:Don't start with microservices – monoliths are your friend by jeremyjh on Thursday December 16, 2021 @08:53AM (#29578068)
Yes I acknowledged OTP apps as a valid structure. An umbrella app is project that builds multiple OTP apps.
Re:Don't start with microservices – monoliths are your friend by ianbutler on Thursday December 16, 2021 @08:54AM (#29578073)
No, you do not even need OTP functionality on the child project, that's my point. Not everything uses OTP.

Edit: We may be talking past each other, from Sasa Juric:

"It’s worth noting that poison is a simple OTP app that doesn’t start any process. Such applications are called library applications." Which is what I'm thinking of. He also says "Finally, it’s worth mentioning that any project you build will mix will generate an OTP app."

I was mainly talking about you don't have to use anything like GenServer or other OTP functionality with the split out app so they're more like the library application but that is still in fact an OTP application even if you're not using any of the downstream OTP features.

Re:Don't start with microservices – monoliths are your friend by jeremyjh on Thursday December 16, 2021 @09:06AM (#29578207)
Each separate child project is still an OTP application, even if you do not use "OTP" features in them. OTP app is just the term for that artifact, similar to assembly or archive in other languages but it is not only terminology, each one will have `start` called when the VM starts, even if they don't spawn any servers.
Re:Don't start with microservices – monoliths are your friend by ianbutler on Thursday December 16, 2021 @09:09AM (#29578238)
Yup which I'm not sure if you replied before I finished my edit or not but I came to the same conclusion.