Howdy folks. We use polylith and component at work. For each of our services, we define a system map from scratch. As we've continued development, we've noticed two trends: • The number of microservices (app systems) we have is growing (in polylith parlance, these are "bases"). Prior to this growth, repeating the same dependency wiring (with some slight variation) in every system wasn't a big deal. But now, low level dependency changes might mean updating the system map of 20+ microservices. • For some of our protocol instances, we want the flexibility of swapping out different implementations (which might have a different set of dependencies altogether). Before I roll something custom, do any of these issues resonate with anyone and if so, what have you done to address them? The main issue being, how do you isolate dependency subtrees (e.g. "modules" perhaps?) so that changing a subtree doesn't propagate to all your app systems?
I don't use Polylith, but many of the services I work(ed) had ways of configuring final shape of the system at run time, e.g. a service could be launched to serve only HTTP traffic, or only handle background jobs or do both. Similarly, some environments required swapping out certain components for alternative implementation (usually a no-op version). The approach that we've taken was to compose systems using functions ( a http-clients function would return a map of HTTP client components, db would return database connection(s) and so on) and use Aero config to decide how to put all of these together.
That said, it's a bit tedious so I'm working on a library which marries Component and Aero to provide a declarative way of encoding systems and deriving different shapes given some inputs.
That sounds interesting. I'd like to see what you came up with. I cooked something up yesterday that seems to solve my problem, and it manages to do so without any dependencies except my code and component.