Nithish Kotte
Explain in which use case we raise events and in which case we use rest APIs.
  • Sonil  Kumar
    Jul, 2021 27

    Rest call are good when you cannot proceed without that step to be completed. It is sync in nature and will give the result (success/failure) before jumping to next step. Although it will give a delay in UI response to the user but also assure the completion of first step before jumping to next.

    Eventing system is good when you can proceed without waiting to complete of any step. Like processing the order, add the result when user submit a question etc. Event system can give a delay in updating the records as it depends on a third system and that must be up and running, but user will not be blocked as it is just a matter of trigring the event with data.

    • 0
  • Sonil  Kumar
    Jul, 2021 27

    Rest call are good when you cannot proceed without that step to be completed. It is sync in nature and will give the result (success/failure) before jumping to next step. Although it will give a delay in UI response to the user but also assure the completion of first step before jumping to next.

    Eventing system is good when you can proceed without waiting to complete of any step. Like processing the order, add the result when user submit a question etc. Event system can give a delay in updating the records as it depends on a third system and that must be up and running, but user will not be blocked as it is just a matter of trigring the event with data.

    • 0
  • Akshay Deshmukh
    Apr, 2020 24

    For 1 to 1 mapping go with rest APIs and for 1 to many (dynamic) mapping go with events.

    Example of 1 to 1 mapping is CRUD operations from ui. When we click save on UI, it will call respective API to update entity in database.

    Example of 1 to many (dynamic) mapping is when order saved in system, various workflows must be triggered. These workflows may not be same for all entities. And thats why, event publish and subscriber model is a best choice.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS