{
Video,
VideoMetadata
}
Video data will be chunked and stored in S3.
Video Metadata will be stored in Cassendra to support high availablity and scalibility.
User data will be stored in Cassendra as well.
DB schema
Video Metadata
{
video_id, string,
name, string,
uploadBy, string,
duration, string,
manifest, Array {
chunk_id, string,
blob_uri, string,
format, string,
quality, string,
}
}
User Info
{
user_id,
user_name,
email,
gender,
...
createdAt,
updatedAt,
}
client -> LB -> uploadService. -> user table
|
S3. <- postprocessing videoMetadata table
|
-> videoService -> /
-> searchService -> ElasticSearch.
Upload video:
Watch video:
Serach video:
Postprocessing service will be triggered by a new chunk being uploaded.
In watch service, service will based on the network and device info to auto pick up the right quality for users. If user choose to stream at a resolution, we will download the corresponding chunks for them.
In search service, the elastic search is indexed based on the videoMetadata like video title.
If Upload/watch/serach service is down, we will have a couple of backup service.
If databased is down, we can switch to replica and restore the db.
If elasticSearch is down, we can switch to secondary ES.
If S3 is down, we may experience a problem. We can have a backup solution like building own blob storage or have another vendor as a backup.
We can use CDN, to cache most popular videos and decrease the latency for user to stream the videos.
We can have another databased called user watch history. This can be used for analytics for user preferences to build a recommendation system.
and can be used to support resume the video in different devices for users.