0

Given the microservices pattern is the decomposition of software by business capability with ownership of state, and a single customer view is an aggregated, central, "single" data store of all customer data that can be used to drive application functionality, are these two patterns able to live together or are they incompatible? If they can live alongside each other, how do you reconcile the apparent contradiction between mono (SCV) vs poly (MSA)?

EDIT:

An example of what needs reconciling, you could have a service responsible for contact information, holding your Customer’s postal address. A SCV by definition holds all customer data, which pretty much could cover the entire estate of data and all state owned by micro services - most data is linked to a customer. Should I query the micro service - the owner of the state and business behaviour - for the customer’s address or should I query the SCV which has aggregated all data associated to a customer. What would be the advantage of having both of these systems in place given the increased complexity and duplication?

5
  • Yes, they can co-exist, because a UI can consume several services. I am not sure what you think needs to be reconciled.
    – John Wu
    Commented May 24, 2022 at 15:03
  • Does this help? softwareengineering.stackexchange.com/questions/372795/… Commented May 24, 2022 at 15:11
  • Included an example.
    – MrPanucci
    Commented May 24, 2022 at 17:29
  • So Single Customer View (SCV) is a concept that describes the user experience, not the architecture of the software. Microservices Architecture (MSA) is a concept that describes architecture of software and not the user experience. It's my opinion that the are tangential at best. Facebook created GraphQL, which has been adopted by many platforms (including NetFlix) to address this very problem. I.e. presenting the data as a unified graph that you can display on screen as you desire. The GraphQL layer is essentially a proxy to the information in the services behind it. Commented May 24, 2022 at 18:34
  • Agree what you described is an aggregated view of data from multiple sources, but in the context of SCV I've only ever seen its implementation described in technical and architectural terms. There's normally a physical data store that brings all this data together in one shared database for querying.
    – MrPanucci
    Commented May 25, 2022 at 9:47

1 Answer 1

1

Yes, they can co-exist.

Both things exist for different, non-contradictory reasons. Microservices exists usually for scaling purposes, either organizationally or technically. To do this, the microservices have to be as independent as possible, optimally with no communications between them, each handling their respective functionality completely on their own. Integrating through the UI for example, or at the worst case have only off-line fire-and-forget type communications.

Having a unified store of customer data is for requirements in the area of data mining / machine learning, etc. This could be easily off-line wrt the services. I.e. microservices can transmit different types of data (live, historic, static, etc.) completely without impacting their functionality i.e. without compromising on their independence.

Again, your architecture should be shaped by your requirements. There is no inherent "advantage" to any of this. If your requirements demand you to do either or both, then you are "justified" in doing it.

2
  • If your unified store of customer data (SCV) is exposed for the UI to query and act on, would you consider this breaking the pattern? What you described makes sense to me, but I'm having conversations where SCV is considered a customer store for making real-time decisions for the customer. For example, we might present a personalised dashboard of based off of the SCV rather than the Microservice state.
    – MrPanucci
    Commented May 25, 2022 at 9:43
  • Possibly. If it's a UI thing (like display certain products, ads, etc. based on profile), I would try very hard to integrate through UI. The Web is great for doing this. In other words, have the "unified customer data" thing serve these highly customized snippets of UI itself, without others needing to "query" anything. This would still not "break" anything. If you would have to "query" the "SCV" live (request-response) during some business function, that I would consider going against the reasons for having microservices. Commented May 25, 2022 at 10:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.