Hi - Question is: Why is pub sub being invoked (for any notifications etc.) via API gateway ? When user adds a comment in the session (i.e. in web session), then shouldnt it get generated here itself, rather than via API gateway ?
1 Like
Hi Neeraj,
Even though the comment could be generated in the web session itself, using the API gateway to invoke the pub-sub model provides these benefits:
-
Decoupling: The pub-sub model separates comment producers (users adding comments) from consumers (users viewing the document). This flexibility enhances scalability.
-
Scalability: As user numbers grow, the system can handle increased load by adding resources.
-
Real-time Updates: Subscribers receive immediate notifications when a comment is added, enabling real-time viewing
-
Asynchronous Processing : Comments are published to a topic asynchronously, allowing the system to continue processing other tasks. Subscribers receive comments when ready, avoiding system blockage.
Thank you.