The Microservice arcitecture is still a new thing for me to work with, so it gives me some unanswered questions.
In my case each MicroService has its own database.
I need a UserService to handle CRUD operation for users. Lets say we have a User table with the columns Id, Name, UserTypeId and a UserType table with the columns Id, Name, Code (unique code to identify the specific user type).
My question is now should the UserService handle the UserType table too or should that be seperated into a new MicroService and then copy the new UserTypes into the UserService by message events?
Now lets say we also want to manage some access permissions for the users. We want a Permission table to hold all the permissions the system contains. My thoughts is to create a PermisionService to handle the permissions CRUD operations and eventually other features regarding permissions.
It should be possible to attach a permission to a user by using a table like UserPermissions (UserId, PermissionId)
Now my question is should I create a new service for handling the attachment and removal of permissions on users or should the UserService also clone all permissions by message events and then handle it in the UserService by having a AttachPermissionsToUser endpoint?
What do you think is the proper implementation?