It doesnβt matter to me where it is so much, except that it cannot be inside one container, as indicated earlier in this topic.
The important part is that only one (1) microservice has ownership of the data. If access to data is required by more than one microservice, they must access it through the API provided by the microservice to which this data belongs .
You can structure it like this:
"Sql Microservice" - processes all traffic to and from SQL Server. All microservices that need data from Sql communicate with these guys. You will have a similar microservice for TableStorage.
If "microservice A" uses a different data store from Sql / TableStorage and this data store is local to Microservice A, I would create 2 microservice.
Microservice A1 will be at the place where your code runs. Microservice A2 has an API that provides access to the database for A1. When A1 needs data, he talks to A2.
Besides the fact that this template allows you to scale the data level regardless of the application nodes, you also guarantee that the data belongs to only one (1) microservice and that the key is . Single owner
source share