Hello experts,
I have 10+ event sourced entity micro services, each representing a subdomain. In order to achieve CQRS, we want to keep our read model separate. I have a requirement where I need to bring data from various (ranging from 1 to 5) entities to return to the UI.
We think we can implement this using the below 2 ways:
- Implementing multiple views tables in a view service where each view table represents a domain entity. We then write query endpoints to query the required entities and join them in the query (using advanced view features).
- Implementing a Value entity service which represents a flatter representation of entities after joining them into a single value entity. We then use service-to-service eventing and update the value entity on all the required events and implement query endpoints which manually parse the value entity data and prepare the response as required by the UI.
We would like to know the pros and cons of these approaches from complexity, performance and any other perspective. Please advise which approach better aligned to Kalix best practices and is recommended by Lightbend.
Thank you!