Practice in order to make the Django simple service by which people can make playlists of their favorite songs.
There is a table containing the names of all the songs of all users, the table users, a table for playlists of all users. There is also an intermediate table to link the songs with playlists.
When registering the user for it creates a hidden playlist where you add all of his tracks (even if he did not choose any of the playlist). When the user adds a new track, which is not yet in the database, it is added to the main database of tracks and through a hidden playlist is bound to the user. If the track is in the database - then just bind to the user. At first glance, nothing complicated.
The problems started when it became necessary to order the tracks by date added for each user separately. Need to sample tracks go in order of adding each individual user, in General, the playlist of the user, and subsidiaries.
I have 2 ideas how to do this:
- Add a field with the date in a hidden playlist
- To remove all hidden playlists, create a staging table with foreign keys to user and track, and date added
What is the best option to choose? It is very important to ensure that the sample worked quickly with a large number of users, tracks and playlists.
Thanks for the replies.