Total user : 100 Million
Lets assume user a user data is : 200Bytes
User space : 100*200 -->. 10Billion --> 10 GB
Storage size for a day :
10Million * 5*1000*1000 -->. 50000Billion Bytes --> 50TB/Day
TPS : 10Million /10000-> ~10TPS
Post : /v1/upload --> data as bytes
Response will be {documentId:"xxxfstw7623672883"}
Get : /v1/docuemnts?userId=''
Response --> {
docId,
created at,
lastUpdated,
LastUpdated by
}
Put : /v1/update/{documentId} --> body will content
Post : /v1/share/{doumentId} Body {List:{usrId}}
User table ->{
userId: string(PK)
email : string(UK)
createdAt:
updatedAt
}
userDocumentMeta ->{
docId : PK
contentAddress: --> Location of data
createdby : userId; --> Index
createdAt :
}
DocumentVersion{
docId: PK
version: String
comment : String
created at : timestamp
updated by : userId
documentAddress: blockId
}
As update is allowed so recommended is to use block storage
ContetTable {
blockId : pK
content: String
offset:
nextBlock:
}
Component ->
Client.
DropBoxServer
DB
BroadCastService : Queue based notification(Client can connect and update latest meta data )
Client :
Server
Client APK/Client side:
BackEnd:
Upload/update flow
Download flow:
How client maintained the data locally?
How updated data stored in backend?
How data will be synced from one client to another client?
How delta will be stored at backend?
How client maintained the data locally?
How updated data stored in backend?
How data will be synced from one client to another client?
How delta will be stored at backend?
DB : For user and meta storage : RelationDB --> Postgres/Mysql
For data content storage: NoSQL --> DynamoDB/Cassendar (Chooses because of availability’s )
Trade Offs
Client pull vs push data sync to backend.
bottlenecks:
Notifying the changes to all the client. For small scale this approach will works.