POST /v1/tweets
POST /v1/users/{userId}/follow
DELETE /v1/users/{userId}/follow
GET /v1/timeline/home?limit=50&cursor=abc
GET /v1/users/{userId}/tweets?limit=50&cursor=abc
POST /v1/tweets/{tweetId}/favorite
Describe the overall system architecture. Identify the main components needed to solve the problem end-to-end. Use the diagramming tool to create a block diagram.
The system uses service-oriented architecture with event-driven fanout.
Tweet creation is synchronous until the tweet is durably stored.
Feed distribution happens asynchronously through a queue and fanout workers.
Home timeline uses a materialized feed for fast reads.
Profile timeline uses assemble-on-read from Tweet Store.
Celebrity users use fanout-on-read to avoid massive write amplification.
Engagement and notification systems are separate from Tweet Service.
The main correctness rule is: tweets should never be lost; feeds, counts, and notifications can be eventually consistent.