The gist of it is that there's one codebase with multiple separate "modules". This codebase is packed and linked as a library and then we build different super slim hosts that load different parts of the monolith in production containers. Usually just different environment variables or config.
But locally, we can run the whole thing in one process. We're.using .NET so `dotnet run` brings up the whole app. Whereas we might run parts of the app in different console hosts in prod, locally they are hosted background services in-process.
From a debug perspective, this is super awesome since you can just launch and trace one codebase. If we broke it out into 3-4 separate services, we'd have to run 3 processes and 3 debuggers. 3 sets of configuration, 3 sets of CI/CD, 3 sets of testing. Terrible for productivity.
We have parts of the system connected to SQS for processing events and if we need more throughout, we simply start more instances of the container all running the same monolith.
I think GCP is probably one of the best platforms for building modular monoliths because of its tight orientation around HTTP push.
1. As part of the same entity, so you could scale your operation.
2. As part of an ecosystem, so you could for example create an entire open banking network or just a regular network with bank transfers and card payments using proper protocols such as ACH, ISO8583 and ISO2022 for example.
And there is a separate concept of a configurable application which can completely reshape its component graph according to some high level configuration flags (like database=prod|dummy), we call it "multi-modal applications".
And we created the perfect tool for wiring them: https://izumi.7mind.io/distage/index.html
For us, it just becomes a matter of configuring the correct construction of the dependency injection container at host startup using some flag (usually environment variable) to pick the right bits and pieces to load into the container and which services to run from the monolith.
Then each of the host "partitions" gets its own Dockerfile.
Monolith on the other hand is a single application with all of the logic in one place.
Distibuted monolith is a set of applications\services like in microservices pattern but they can share common data storage and depend on each other.
Stateful vs Stateless.
Your monolith is a binary that gets distributed to hosts to perform some function. The binary has multiple entry points that can be envoked. Most calls are via internal library call.
Microserverices (also stateless) have a different artifacts for each component, services call other services via a private API (often grpc/httprc).