I'm designing a reactive microservices system, where communication between services – request processing pipeline – is async (using kafka). The system will manage cluster of VMs. Panning to use Spring WebFlux as a framework.
For example, request to create new VM might look like this:
- API Gateway
- Security Validation
- Create VM in the userspace
- Schedule resources for VM
- Send notification to the user once succeeded/failed
All the steps are sequential, yet async, thanks to kafka. Steps are processed by separate microservices.
Besides that, client will (might) want to issue GET requests, like get list of VMs, or info about cluster state. And I just don't know how. I can think of the following solutions:
- Make (synchronous) GET requests from the API gateway to other services, aggregate data and return.
- Notifications to the user already have all the required data, so I can aggregate all user-queryable data in dedicated service (save to the database) and forward GET requests from API Gateway there.