I work in a company that owns multiple other companies (each have it's own apps), and we are starting to centralize some data, for example, now we have a service that will share customer data for every company, let's name it CustomerService.
The project i'm working uses a subscription model , where the customer can subscribe to a health insurance plan and can have only one active plan (let's call it HealthInsuranceService).
We have to show which plan the customer is subscribed in some apps from our ecosystems, for example, we have a drugstore app and we have to show which plan this customer has in the customer profile in the drugstore app. In terms of DDD which option is better?
Do we have any better option?
None of those strikes me as intrinsically any worse than the others from a strictly DDD perspective. Which one to choose depends on what's important to the problem.
Option 3 is probably what I'd tend to go for (which is basically CQRS) is what I'd tend to go for in order to ensure service autonomy, but that autonomy entails looser consistency guarantees (i.e. a change to the insurance plan might not show up immediately in the drugstore app). If a stronger consistency guarantee is warranted, on the other hand, option 3 is almost certainly the worst of the 4 options.