My apologies @mauroservienti if this is an inappropriate place to ask this question. Please let me know where would be a better forum.
I have watched this repository's related YouTube videos with specific interest around the question at https://youtu.be/KkzvQSuYd5I?t=2621. Your answer describes a separate service generating a PDF invoice using appenders to compose the data (view model) to use in a template, the service then persisting the PDF for later client retrieval.
I mention this use case as I think it might be how I would solve the following requirement but I'm not entirely certain.
The System
So lets say I have a set of services such as in your repository that facilitate an ecommerce mobile application. The services are deployed in 2 cloud regions, one in the US and one in Europe. Customers in each region's country are routed to the nearest region. There is no data replication between the regions. They are effectively two different ecommerce shops with their own products for sale.
The Requirement
Customers can travel to both the US and Europe and so can make purchases from both regions under the same identity. A customer signed into a mobile app using the one identity should be able to see their global order history (receipts) no matter what region their mobile is routing to.
The Problem
If each region has data isolation then no one region has a view of all orders made by a customer globally.
A Possible Solution?
Each region should have an OrderHistory service that can listen for OrderCompleted events from Sales to trigger an ArchiveOrder command. The command handler would use appenders (supplied by the Sales, Marketing, etc) to obtain a model of data to store as an archive record. After persistence it could publish an OrderArchived event letting the other services know they can delete their CartId related data.
The backing store of the OrderHistory service could be a globally-available store such as CosmosDb or MongoDb where each region's service uses the same database. No matter the region routed to from the mobile app when viewing order history, the same combined dataset is surfaced to the customer.
This has the added benefit of limiting data in the other services to only those orders that are not complete.
Does this sound like an appropriate solution without breaking SOA principles? Or do you see simpler alternatives?
Again, apologies if not the place for this question.