I just learned about Polylith and watched the youtube video about it. I'm sorry for not a very good title for my post but I am new to all these concepts and I couldn't come up with a better description of my query.
My understanding is that we can "compose" or "assemble" different systems out of a number of components. For example we can have a system with the following components (like in the RealWorldExample app):
All these components use a database component to manage their state (e.g. user or article database entities).
Now we can have one arrangement of these components in a single system - like in monolith app. We can also decide that we want to split them up so we can scale different components independently, e.g. articles component is much more used and we need more instances of it running so we might decide that we have one system that will have just article component and another system that will host user and comment components.
Is my understanding so far correct? If yes, then my question is: article component might need to use user component (or the other way around). How these components would communicate with each other? The RealWorldExample provides a interfaces with their implementations where they are called directly "in process" as Clojure functions. Would we have different interface implementations provided (e.g. using a REST client to talk to a component that runs in a different system instance) and link them accordingly to their systems? Is there any example how this is made? If not I think it would be very helpful to have an example of such "micro service" version of the RealWorldApp provided so we can see the flexibility of this architecture.
Or maybe I am wrong and we can just have multiple systems where we always include all the components that are required by other components in a particular system? I guess not but I am not sure 🙂