Introduction
In this article, I will talk about my analysis of YouTube Music's database. I am doing this just for practice to get a better idea of the DBMS.
I am a freshman at university, not a professional software engineer, so there could be a misinterpretation. It is my pleasure if you can leave some comments on how you would alter what I have done or which part I can make improvements.
I only created the database for major features, such as a playlist, user account, song, singer, etc because it is too many if I do all.
Structure
There would be much more entities and attributes in their actual database system, but I added the attributes that I could identify by looking at the app.
Entity Relationship Diagram
I am sorry for the watermark (I am not using a pro, so)
This is a photo without the watermark, but it is less clear.
Challenges
The most challenging part was identifying the attributes. For example, I was unsure because I thought the TopArtists entity should have ARTIST_ID to identify other attributes, such as COUNTRY_ID, FOLLOWER_ID, ARTIST_FNAME and ARTIST_FNAME. Accordingly, I am not sure if it is correct to leave the TopArtists entity like that. I decided to leave it like that because it has a 1-to-many relationship with the Artist entity. The foreign key must be on the "many" side, which is the Artist entity.
Another challenge was identifying the data type for the ALBUM_COVER attribute under the Albums entity. The album cover will be the image, so I thought about it for minutes. I was able to find two options.
VARBINARY(n) and VARBINARY(max)
VARCHAR()
VARBINARY() is similar to the VARCHAR type, but stores binary byte strings rather than non-binary character strings.
VARCHAR() can be used when we want to store an URL (or path) of the image.
In my ERD, I chose to use VARCHAR().
Conclusion
My ERD and database structure could be wrong, so please give me some feedback, so I can learn from you guys. Thank you for reading :)