-
User should be able to access the app on Mobile and Website
-
Only English
-
User should be able to access a feed of pictures a. User should see pictures from the pages followed b. There should be extra recommended or spondered posts
-
Order of the posts. Assume sported by time (latest)
-
User should be able to post pictures or videos
-
user should be able to like and comment
-
Search
How many users? Scale to 500M users
Post once a day on average. 60 million pictures posted per day 35 million videos uploaded per day
Reading 20 requests per day
Some accounts are going to be large and some small
On premise
- Scalability
- Availability and Fault Tolerance 99.9999
- Elasticity and performance
Latency - Performance.
Consistency - Eventual 1 hour consistency
Data Design
1 picture. 10kb 1 video. 1mb
60M * 10kb = 10gb * 60 = 600 GB per day pictures 35M * 1mb = 35 TB per day of videos
20 request per day per user:
20 * 500M = 10B content per day
100KB * 10B per day / 10 ^5 = 100Kb * 1M = 100GB per second
Users
- id
- name
- description
Followers
- followerid
- followedid
Content -id -type(video or picture) -createddate
Feed Data
- userid
- ListOfContentId
Comments
- id
- contentid
- userid
- commentText
- datetime
Likes
- id
- contentid
- userid
- datetime
Videos -id -desctition -size -datecreated
Pictures -id -desctition -size -date
Feed Data
- userid
- ListOfContentId
Comments
- id
- contentid
- userid
- commentText
- datetime
Likes
- id
- contentid
- userid
- datetime
POST /uploadVideo VideoId VideDesctiption
if Success
- POST /uploadVideoData BINARY OF THE VIDEO Response
Tell the user if success or failure
https://excalidraw.com/#room=7df977a70821966fce9d,GMBCEhLebt5SLCR-OlVqFg
Latency Steam processor... tight processing...