With appying Materialized View Pattern, we have duplicated data into our system.
▪ Duplicating data is not a anti-pattern, have strategically duplicating our data for microservice communications.
▪ Only one service can be a data ownership.
▪ How and when the denormalized data will be updated ?
▪ When the original data changes it should update into sc microservices.
▪ Need to synchronize the read models when the main service of data is updated.
▪ Solve with using asynchronous messaging and publish/subscribe pattern.
▪ Publish an event and consumes from the subscriber service to update its denormalized table.
▪ Using a scheduled task, an external trigger, or a manual action to regenerate the table