System design · HLD
Dropbox
Functional req
1.user should be able to upload file from device
2.user should be able to download file
3.user should be able to share a file and view shared files with them
4.user should be able to sync all files across devices
Non functional req
1.availity > consistency
2.low latency
3.support file size upto 50 gb
4.system should be secure and reliable. We should be able to recover files if lost or corrupted
Core entities
User - a person using this dropbox
File meta data - metadata of the file , store information like file name , desc
File - raw file that user will be uploading/downloading
API Design
-uploading a file :
POST /files
Request :
{
File,
fileMetadata
}
-download a file:
GET /files/{fileId} -> File & FileMetaData
-share files
POST /files/{fileId}/share -
Request :
{
User[]
}
- Sync to the local device
GET /files/changes?since={timeStamp} -> ChangeEvent[]
And for all these user information will be shared through JWT json web token
(good as users will be authenticated and authorized to perform actions while preserving security )
https://claude.ai/public/artifacts/59aa1935-bb28-4be7-a12e-f4acb1da89ec