I am trying to get my head around "event driven" microservices. I understood, there are several techniques and patterns, like event notification, event sourcing, CQRS, etc that can help us to achive that. Very simply said, it boils down to some kind of a command has been sent, which leads to a change of the systems state. If the change was applied, the system emits an event. Other services can listen to this events.
But what about querying a microservice for data? Let's say we have an API gateway and some services behind that gateway. Now we want to get a list of all users
, which are stored in the user-service
. The API gateway could simply send an HTTP GET
request to the user-service
to receive the list of users
. In some kind this might lead to tight coupling, but it seems like the most plausible way.
Can you share your knowlage and experience, when someone should not use HTTP requests for querying a microservice and what alternatives there are.