This repository describes the system design of social network within the course.
The system should meet the following requirements:
- Add and delete friends
- View users' friends
- View user's profile
- Publish posts
- View feed of posts (home and user feed)
- Upload media files for posts
- Send and read messages in one-on-one and group chats
- View one-on-one and group chats
- 50 000 000 DAU
- Availability 99.99% (52.56 minutes downtime per year)
- The system should be scalable and efficient
- Each user sends an average of 1 post per 3 day
- Each user reads feeds an average of 10 times per day
- The size of each post is a maximum of 3000 characters
- The size of each media files is a maximum 1MB
- 10% of posts contain media files
- Each post has a maximum 3 media files
- A message should reach the recipient in 3 seconds
- Each user sends an average of 10 messages per day
- Each user reads messages an average of 20 times per day
- The size of each message is a maximum of 1000 characters
- A user can have a maximum of 1000 friends
- A group can have a maximum of 100 participants
- Posts and messages are stored forever
- Geo distribution is not supported (CIS only)
- No seasonality
Text traffic:
Media files traffic:
Total:
Database size for storing messages for 5 years:
Database size for storing posts for 5 years:
Total:
Number of disks (disk capacity = 16 TB):
Level 1. System context diagram
Level 2. Profile system container diagram
Level 2. Relation system container diagram
Level 2. Post system container diagram
Level 2. Media system container diagram
Level 2. Message system container diagram