Since we have user involved, we want to ensure data integrity, we can have JWT in the header.
POST v1/upload
{
checksum
parts: [{checksum}]
}
GET v1/{video_id}
GET v1/videos?{text} => 200 m3u8 file
Video File
====
file_id PK
user_id FK
checksum
s3_uri (To directory)
s3_uri (To manifest file)
Part
====
part_id PK
file_id FK
checksum
s3_uri (To specific raw file)
User
====
user_id
Explain how the request flows from end to end in your high level design. Also you could draw a sequence diagram using the diagramming tool to enhance your explanation...
_Video upload failure_
> In our previous design, we can use the checksum to ensure we dont reupload the uploaded parts.
_Better failure recover on video upload and also less network overhead_
> S3 presign url. We presign the url and allow user to PUT from client side to S3. This is secure because we use sigv4 request signing algo that we include request headers and request body (body is added in v4 compare to v2)
_Better viewing and video catalog experience_
> We can store video with content delivery network (CDN), a pull based CDN like Cloudfront. For Netflix case, we can use a push based CDN like OpenConnect because we know what videos are likely attract lots of traffic by release schedule. The thumbnails can be on CDN.