Scenario
I am building courier service system using Microservices. I am not sure of few things and here is my Scenario
- Booking API - This is where customer Place order
- Payment API - This is where we process the payment against booking
- Notification API - There service is responsible for sending the notification after everything is completed.
The system is using event-driven Architecture. When customer places booking order , i commit local transaction in booking API and publish event. Payment API and notification API are subscribed to their respective event.
My Questions is
How do we acknowledge the client ? When customer places booking order i commit local transaction and publish event but i need to wait for Payment and Notification service to acknowledge me back via events when they are done. After publishing the event my booking service can't block the call and goes back to the client (front end). How does my client app will have to check the status of transaction or it would know that transaction is completed? Does it poll every couple of seconds ?
That's was best case scenario . But since this is distributed transaction and any service can go down and won't be able to acknowledge back . In that case how do my client (front end) would know since it will keep on waiting. I am considering saga for distributed transactions.
What's the best way to achieve all of this ?
Event Sourcing
I want to implement Event sourcing to track the complete track of the booking order. Does i have to implement this in my booking API with event store ? Or event store are shared between services since i am supposed to catch all the events from different services . What's the best way to implement this ?
Many Thanks,
Aucun commentaire:
Enregistrer un commentaire