Spotify music streaming database schema

How a music streaming service models its data: artists, albums and tracks, credited roles on a track, ordered playlists with collaborators, saved library, offline downloads and an append-only play log.

Spotify ER diagram

Spotify music streaming database schema n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 users idBIGINT emailVARCHAR display_nameVARCHAR country_codeCHAR product_tierVARCHAR birth_dateDATE created_atTIMESTAMPTZ artists idBIGINT nameVARCHAR sort_nameVARCHAR bioTEXT verifiedBOOLEAN monthly_listenersINTEGER created_atTIMESTAMPTZ albums idBIGINT primary_artist_idBIGINT titleVARCHAR album_typeVARCHAR release_dateDATE upcVARCHAR labelVARCHAR total_tracksSMALLINT tracks idBIGINT album_idBIGINT titleVARCHAR disc_numberSMALLINT track_numberSMALLINT duration_msINTEGER isrcCHAR explicitBOOLEAN is_playableBOOLEAN track_artists track_idBIGINT artist_idBIGINT roleVARCHAR positionSMALLINT playlists idBIGINT owner_idBIGINT nameVARCHAR descriptionVARCHAR is_publicBOOLEAN is_collaborativeBOOLEAN snapshot_idVARCHAR created_atTIMESTAMPTZ updated_atTIMESTAMPTZ playlist_items idBIGINT playlist_idBIGINT track_idBIGINT positionINTEGER added_by_idBIGINT added_atTIMESTAMPTZ playlist_collaborat… playlist_idBIGINT user_idBIGINT can_reorderBOOLEAN invited_atTIMESTAMPTZ follows idBIGINT follower_idBIGINT artist_idBIGINT followee_idBIGINT followed_atTIMESTAMPTZ library_items idBIGINT user_idBIGINT item_typeVARCHAR track_idBIGINT album_idBIGINT playlist_idBIGINT added_atTIMESTAMPTZ play_events idBIGINT user_idBIGINT track_idBIGINT played_atTIMESTAMPTZ ms_playedINTEGER context_typeVARCHAR context_idBIGINT device_typeVARCHAR skippedBOOLEAN downloads user_idBIGINT track_idBIGINT device_idVARCHAR bytesINTEGER qualityVARCHAR downloaded_atTIMESTAMPTZ license_expires_atTIMESTAMPTZ

Related database schemas