I am working on a microservice architecture application. Each microservice can live on its own, has no direct dependencies on other microservices in the system. In each microservice, we use CQRS and event sources to report changes in service status. Other services are informed of these events if they are interested and can update their data.
So far, the system is working very well. If one microservice does not work, others still work. After the interrupted service starts again, she will receive all the events that occurred in her absence and will update her own state depending on these events.
Now we need to provide our services, and for this we use IdentityServer. We have another service, our security service, which will be called by other microservices to get a token. This is the first time that a microservice must talk directly to another microservice.
My problem with this approach is that if the security server is down, the whole system is down.
I am thinking of the following solution:
Each microservice must store user data in its own database. If the user accesses the microservice, the user authenticates inside the service without remotely invoking the security service. I still need to have a security service to manage users. Changes in users will raise events again, and other microservices can update their user data. Of course, everything is with https. And perhaps to reduce redundant code for security, I could use the nuget package.
Do you think this is a smart approach?
Thank you for your advice.
source share