Requirements of the Pub-Sub API

Learn the functional and non-functional requirements of a pub-sub service.

In the previous lesson, we discussed the structure of the pub-sub service. It’s an intermediate component in a microservice architecture that makes asynchronous communication possible between multiple services. Therefore, it needs an efficient API to direct the communication between the services. This lesson focuses on the requirements to design an API for the pub-sub service.


We identify the following essential functional and non-functional requirements for designing the pub-sub API.

Functional requirements

The pub-sub service should allow the following features to a user:

  • Create topic/publish event: The pub-sub service should enable a user (publisher) to create a topic or publish an event related to any topic.

  • List topics: The service should allow users to request a list of available topics.

  • Subscribe: The service should allow users to subscribe to a specific topic.

  • Unsubscribe: The service should allow users to unsubscribe from a specific topic after they've subscribed to it.

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