Storing a music playlist, best approach

database-designusers

I am working on a web project that creates playlists online based on youtube links.

My question is how do I store a playlist on MYSQL. What I was thinking about doing was having a table with basically all information. something like this

example table

I could query this and get information "WHERE playlist_name=bob" and get every song in bobs playlist. Does this seem like a good route? Is it a problem that the table will eventually get huge? what about storing each playlist in a separate table, so bobs_playlist would be a whole new table. This would end up with MANY tables, is that a problem? are both approaches valid? is one better than the other? I just cant determine the best way to organize the information.

Best Answer

I would approach it with this structure:

Diagram

This way you can have a more normalized structure, non-repeating data and simple tables.

In this method you would also be using WHERE PlaylistID=[bobs playlist id] instead.

With this structure's simplicity, you wont have to worry about any size issues for a long time. This structure will quickly handle millions of records. If you get bigger than that you can look into partitioning; that's not necessary for now.