Comment API Design Decisions

Learn some intricacies in the design of our proposed API for the comment service.

The API design for a service not only depends on the organization's requirements and the services they provide, but it also depends on the internal details of the system's overall architecture. These decisions further pave the way to adopt a specific API architecture style to direct the communication between the clients and back-end services. In the following section, we'll discuss the detailed working of the comment system and the interaction between various components, which enable us to make some design decisions before embarking on the design problem.

Design overview

The following figure demonstrates how a comment system works. All client requests are passed through the API gateway and fan out to multiple back-end services. Upon receiving a comment for a post, the back-end server sets various attributes for the comment, appends it to the relevant post, and stores it in the database. Other requests, such as updating or deleting a comment, are handled similarly.

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.