microservices question
I have a auth-service that stores users' credentials like emails, passwords etc. and user-service that stores users' profile info such as usernames, avatars, how do I handle user registration process? I have a gateway written using spring cloud gateway; when the user makes a request to register, they send an object with email, password and username, I want the email and the password to go to auth-service and username to go to user-service. Is it reasonable here to allow for communication between user-service and auth-service?
11 Replies
⌛ This post has been reserved for your question.
Hey @IamMax420! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./closeor theClose Postbutton above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
I assume the auth service also needs the username? Then I'd guess first send it to the auth service, handle the authentication and if it succeeds, request the profile information
doesn't that break the 'no communication between microservices' rule tho?
There will need to be some sort of communication between microservices - the question is how you do that
ofc it would also be possible for the auth service to return a JWT which can be verified by the user service
maybe using a message queue here would work?
the gateway produces 2 events to which auth service and user service are subscribed
that is one way of communication between microservices just like REST is one way of doing that
you're right, but I haven't dug that deep yet into microservices, is it generally not recommended for services to communicate with each other? or is it rather ok
They need to communicate in some way but you should keep them decoupled
message queues can make it easier to make them decoupled but they add complexity
facts
I'll think about REST or rabbitmq or something like that, thanks
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
Post Closed
This post has been closed by <@589517424093691905>.