I am writing a music player for the sake of learning. I am not sure how to design the database part of it (I want to create it myself, not use some version of MySQL). My best idea so far is to create a "song" class, with filename, title, artist, album, etc. variables. Then I would have an array of "songs". This works well enough, but when it comes to updating, it seems horrendous. To add one song to the library, it has to be checked against every other song. With a significantly large library and/or a large update, this becomes undesirable (n^2?).
I know a little bit about data structures. I was thinking some sort of hashing function could speed this up, but my knowledge of hashing is very limited.
My question: what is a better design for a music library database and updating said database?
Thanks,
Tim
Edit: I am programming in Python.