Open oscarb opened 7 years ago
Suggested tables for a relational database
id | phoneNumberHash |
---|
id | timestamp | fromUser | linkId |
---|
id | shareId | toUser | category |
---|
id | shareId | toUser | category | archivedTime |
---|
id | url | title | suggestedCategory | hits |
---|
id | type | artist | duration | provider |
---|
id | type | channel | duration | provider |
---|
id | type | author | readTime | provider |
---|
Suggested structure for JSON documents.
{ id: 1,
phoneNumberHash: 'a7fc6d998e889acf779',
links: [
{linkId: '54', sharedByUser: 5, timestamp: 4657894},
{linkId: '37', sharedByUser: 8, timestamp: 1325489}
],
archivedLinks: [
{linkId: '12', sharedByUser: 5, timestamp: 4657894, archivedTime: 7894563},
{linkId: '78', sharedByUser: 9, timestamp: 8798453, archivedTime: 4654213}
],
sharedLinks: {
{linkId: '12', timestamp: 4657894, sentToUsers: [{userId: 7}, {userId: 9}, {userId=23}]}
]
}
...
{ id: 12,
title: "Epic fails of summer 2016",
url; "https://youtube.com/watch?v=4a5a3c45d",
videoDuration: 64,
provider: 'YouTube',
suggestedCategory: 'watch'
hits: 455
}
...
The database needs to be designed to efficiently support queries such as:
Less priority but still of value would be the possibility to: