External service - Users
UserFeedEntry - Generated feed for the user
Tweet - Message created by the user
TweetLikes - Storage for likes
Follow - Entity representing a follow from user a to user b
Routes:
/users/{id}/feed - get current feed of the user
/users/{id}/tweets - post new tweet
/tweets - api for tweets - access etc.
Tweets are being stored as a single entry, with user relation etc.
Tweet likes are stored separately so we have possibility to access who left a like instead of having a simple counter
Follows are used to create UserFeedEntry
We store these entries each time a followed person leaves a new post
Then when accessing the data, we can sort it and limit how we want. With proper indexes it should be quick.
Deep dive into 2-3 key components. Explain how they work, how they scale, discuss tradeoffs, capacity, and any relevant algorithms or data structures.