-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema
More file actions
88 lines (76 loc) · 2.14 KB
/
schema
File metadata and controls
88 lines (76 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# DynamoDB Single-Table Schema (AWS Refactor)
Table: collab-done-single-table
Primary key:
- pk (string)
- sk (string)
Global secondary indexes:
- GSI1: gsi1pk, gsi1sk
- GSI2: gsi2pk, gsi2sk
Entity: PROFILE
- pk: USER#{userId}
- sk: PROFILE
- entityType: PROFILE
- gsi1pk: PROFILE
- gsi1sk: {usernameLower}#{userId}
- attributes: username, bio, website, avatar_url, absolute_avatar_url, instagram_url, twitter_url, spotify_url, soundcloud_url, roles
Entity: SONG
- pk: SONG#{songId}
- sk: METADATA
- entityType: SONG
- gsi1pk: SONG_FEED
- gsi1sk: {createdAt}
- gsi2pk: USER#{artistId}
- gsi2sk: SONG#{createdAt}#{songId}
- attributes: artist, artist_id, genre, needs, description, song_url, absolute_song_url, absolute_avatar_url
Entity: COMMENT
- pk: SONG#{songId}
- sk: COMMENT#{createdAt}#{commentId}
- entityType: COMMENT
- gsi1pk: COMMENTS_FEED
- gsi1sk: {createdAt}
- gsi2pk: USER#{userId}
- gsi2sk: COMMENT#{createdAt}#{commentId}
- attributes: user, comment, commentPosition, avatarURl
Entity: COLLAB_REQUEST
- pk: SONG#{songId}
- sk: COLLAB#{userId}
- entityType: COLLAB_REQUEST
- gsi2pk: USER#{userId}
- gsi2sk: COLLAB#{songId}
- attributes: username, absolute_avatar_url, added_at
Entity: CHANNEL
- pk: CHANNEL#{channelId}
- sk: META
- entityType: CHANNEL
- attributes: created_by, message_to, slug, created_by_username, pairKey
Entity: CHANNEL_MEMBER
- pk: USER#{userId}
- sk: CHANNEL#{channelId}
- entityType: CHANNEL_MEMBER
- attributes: channelId, updatedAt
Entity: CHANNEL_PAIR
- pk: PAIR#{sortedUserA#sortedUserB}
- sk: CHANNEL
- entityType: CHANNEL_PAIR
- attributes: channelId
Entity: MESSAGE
- pk: CHANNEL#{channelId}
- sk: MSG#{insertedAt}#{messageId}
- entityType: MESSAGE
- gsi2pk: USER#{userId}
- gsi2sk: MESSAGE#{insertedAt}#{messageId}
- attributes: message, user_id, username, absolute_avatar_url
Entity: WS_CONNECTION
- pk: CONN#{connectionId}
- sk: META
- entityType: WS_CONNECTION
- gsi2pk: CONN#{connectionId}
- gsi2sk: META
- attributes: userId, connectedAt
Entity: WS_SUB
- pk: CHANNEL#{channelId}
- sk: CONN#{connectionId}
- entityType: WS_SUB
- gsi2pk: CONN#{connectionId}
- gsi2sk: CHANNEL#{channelId}
- attributes: connectionId, channelId