Messenger API Design Decisions
Understand some of the primary technical considerations that will direct the design of the Messenger API.
Introduction
The design of Messenger API will involve many services that each play a role in sending, receiving, and storing user messages. In this lesson, we’ll go over Messenger's high-level design and the workflow for handling requests of different functional requirements. Next, we’ll consider some technical aspects that affect our design decisions—for example, API architectural styles, communication protocols, and data formats.
Design overview
The following illustration shows the components and services involved in Messenger API. Incoming requests go through three main services:
Asset service: This service handles media and documents sent via chat messages.
User data services: This service manages user profile data and the relevant metadata.
Real-time services: These services are responsible for two-way user communication, such as chat.
Apart from these services, there are also some components that facilitate these services, such as Zookeeper and messaging queue. The detailed responsibilities of each of these services and components are listed in the table below:
The following table discusses the purpose of each component in the Messenger system:
Components and Services Details
Component or Service | Details |
User data service |
|
Asset service |
|
Messages service |
|
Messaging queue |
|
Zookeeper |
|
WebSocket manager |
|
Chat server |
|
Presence server |
|
API gateway |
|
Workflow
Let's discuss the workflow of the Messenger service in detail. First, the login process is initiated via the API gateway, where the request is authenticated and authorized based on the data fetched via the user data service. In the next step, when a sender intends to ...
Level up your interview prep. Join Educative to access 70+ hands-on prep courses.