I am trying to get my head around setting up few independent services with their own database, but cannot understand how downtime of one of them should be handled by others
The use case is simple.
suppose there is an Identity service
it issues security tokens, can be configured to have many clients, can be used to administer users, groups, roles, permissions
and there is a client "A" service.
There client can register in system A, pass registration by providing some data to client A website, and use client A specific pages, services
now client A service wants to use user roles, permissions specific to client A user to limit his access to resources.
so client A needs to do the following:
ask identity service to add roles, permissions as user goes through registration and his profile is approved by business process
and after identity issues token the client A service can use the token claims and decide where the user has access to
There are two options:
1) RPC into identity service - need to think about possible downtime of identity svc
2) push message to identity service - dont need to think about possible downtime of identity svc
The downside of 1) - is the downside of using RPC - what happens when identity is temporarily unavailable - should client A service have retry logic?
The downside of 2) - is the identity service should become a downstream bounded context - so it becomes depending on client A bounded context - thus the logic of client A roles leaks into identity service, - for example client A service throwing a message - "registration completed" - should be translated in identity as: when client is client A, and message is "registration completed" -> add role "registered"
Which approach would you use?