Designing User Service
User Service is responsible for managing user-related functionalities in the Twitter-like service. It handles user registration, authentication, profile management, and follower-followee relationships. Let’s dive into the low-level design of User Service. Figure 11.6 shows the User Service high-level architecture, where we have the client request flowing through the load balancer, API gateway, and User Service and interacting with the user and follow tables.
Figure 11.6: High-level architecture of User Service
Each service is defined by the set of API endpoints it exposes to its clients and how it stores the data. We will cover both these aspects next.
User Service will expose the following API endpoints:
POST /users
– create a new user account:Request body
: User information, such as username, email, and passwordResponse
: Created user object with assigned user ID
GET /users/{userId}
– retrieve...