If you're using K8s, what I would suggest is:
- create multiple releases of your Mix project[1] with specific OTP applications in each
- one Docker container per release
- one K8s Deployment per release
- one headless K8s Service selecting the pods for all your deployments
- use libcluster for automated cluster formation
Then, with node affinity/tolerations, you can control on which physical node you'll run it (if you want).If you're not using K8s, you can use an Ansible playbook to deploy each distinct release on the target host, and you can use libcluster with a static cluster configuration. This will work the same.
[0] - https://medium.com/@david-delassus/elixir-and-kubernetes-a-l...
[1] - https://elixir-lang.org/getting-started/mix-otp/config-and-r...
I asked the more senior Elixir devs if we should do something to take advantage of the platform and was met with shrugs.
- a DAL (Data Abstraction Layer) service
- a Business Logic service (talking to the DAL)
- an API (talking to the Business Logic service)
- a Frontend (talking to the API)"
For me what you describled is just a common monolith.I've been developing for 8+ years and have seen this model at every company where I've worked. I really thought this was just the "standard" way that everybody used to develop. I've also worked on a couple of CQRS architectures but the "layering" is still very similar to what you described.
I'm curious now, how do other monolith architectures look like if not like this?
Nobody said a monolith can't be split in modules :)
IMHO, a well-written monolith is like a microservice architecture but without the network layer in between boundaries.
Literally add one character to one of my liveview modules:
Rebuilding...
Compiling 67 files (.ex)In the project I work on, it turned out a module `use`d by almost every controller included a function (totally unused, btw) which, through a little bit of indirection, caused a circular compile-time dependency between all of them. So any change to any controller caused hundreds of files to rebuild.
Microservices are a solution for an organizational problem, not a tech one. You need multiple teams to work on the same system without blocking each others. This is a solution for huge corporations, not your 2 pizzas team startup.