System Design - FB Live Comments Flashcards

1
Q

Func Requirements

A

1) Viewers can post comments on a Live video feed.
2) Viewers can see all comments in near real-time as they are posted.
3) Viewers can see comments made before they joined the live feed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Non-Functional Reqs

A

System should scale to support millions of concurrent viewers and thousands of comments per second.

System should prioritize availability over consistency, eventual consistency is fine.

System should have low latency, broadcasting comments to viewers in near-real time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Core Entities

A

User: A user can be a viewer or a broadcaster.

Live Video: The video that is being broadcasted by a user (this is owned and managed by a different team, but is relevant as we will need to integrate with it).

Comment: The message posted by a user on a live video.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

APIs

A

POST /comment/create
Header: JWT | SessionToken
{
“liveVideoId”: “123”,
“message”: “Cool video!”
}

GET /comments/:liveVideoId

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Simple High Level Design

A

Commenter Client: The commenter client is a web or mobile application that allows users to post comments on a live video feed. It is responsible for authenticating the user and sending the comment to the Comment Management Service.

Load Balancer: Its primary purpose is to distribute incoming application traffic across multiple targets, such as the Comment Management Service, in this case. This increases the availability and fault tolerance of the application.

Comment Management Service: The comment management service is responsible for creating and querying comments. It receives comments from the commenter client and stores them in the comments database. It will also be responsible for retrieving comments from the comments database and sending them to the viewer client – more on that later.

Comments Database: The comments database is a NoSQL database like DynamoDB or MongoDB that stores the simple comment document. It is a document database, which means that it stores data in JSON-like documents. This is a good fit for our use case because we are storing simple comments that don’t require complex relationships or transactions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly