Welcome Guest, Not a member yet? Register   Sign In
SQL architecture ?
#1

[eluser]Unknown[/eluser]
Say i want to create a database of all my music. First i have a table, 'songs', with columns for each peice of info for each song; id, artist, album, name, length, etc etc.

Firstly; i want to add playlists; how should i do this?? (performance being key)

1) Add a column for each playlist with true/false(or empty)
2- Create a new table for playlists... (column = pl name)
-a) Each song's id is on a new row
-b) There is only one row and the entire playlist is stored as one cell containing something like a JSON array, of the song IDs
3) Just store it like a JSON array or similar of song ids, in a file for each playlist.

I would be inclined towards 3, although i fear it might not perform well where queries need to be ran alongside it.. for example to search for songs where artist = X, within a playlist.

Secondly;
Would you suggest i use an SQL database rather than something like mongoDB?? The server will be very weak, and may deal with up to 50k entries (songs).
If SQL.. postgreSQL? or ??
#2

[eluser]Jan_1[/eluser]
You might start with something like

one table for playlistname, dates, infos, etc.
onemore where you connect playlist and songs (id_playlist, id_song, number (which song of the playlist)
one table for your songs

You might think about a database thats easy to handle to you. I did start with mySQL
#3

[eluser]InsiteFX[/eluser]
From what I have seen of the players out there most use an XML playlist.
#4

[eluser]Unknown[/eluser]
^just to be clear this would be a central database with all the songs, and then playlists can reference some of these songs.

Jan, I'm not sure what you are referring to 'dates' and 'infos'.. of the songs?? or playlist's last modified time??




Theme © iAndrew 2016 - Forum software by © MyBB