Closed mohit-rathee closed 1 year ago
1st way: Store all channel/people 's metadata into single table and then store all messages into single table (this is the minimal approach to solve this problem) 2nd way:
Store all channel/people 's metadata into single table and then store messages from diff channel/people into diff tables (this too is an easy one but this may take additional storage)
1st way:
we can create diff databases for each server and have same kind of layout in every server and when different severs coexists we can easily distinguish between diff database 2nd way: we can define single database and inside that we have to use additional queries (this could be a threat as if we want to get data for single server we are actually doing a lot under the hood )
we need to add extra table to mange media too which store media id ,media metadata, media hash
| ID | METADATA | HASH |
| 0 | image.jpg | 3e..9d |
| 1 | app.py | 5g..2e |
For different servers at same time:
| ID | NAME | ADMINS |
|ae..fe| AlienX | 1,2,4,5|
|xf..ce| BEN10 | 1,3 |
Admins are just id's in users table Here id is a unique identifier, may be uuid. Name can be anything.
["server1", [[ch1],[ch2],[ch3],...], [[md1],[md2],[md3]] ]
["server2", [[ch1],[ch2],[ch3],...], [[md1],[md2],[md3]] ]
serverList = {"app":[ [channel1],[channel2],...],"test":[ [channel1],[channel2],...] ]
mediaList = {"app": [ [media1],[media2],...] ],...}
where channeln
=> info of nth channel
and median
=> info of nth mediadone centuries ago
how tables and databases gonna look like Make it efficient and super complex