WhyDoWeNeedADiscID
Screwtape speaking, here
Nemo asked me to look at a thread on the FreeDB messageboard about an XML-based query format for FreeDB, and comment here. Not on the XML-bit, but because nemo posted a link to NCDI and someone else posted and said it was rather a bad idea.
If that link above is dead, let me summarize:
- nemo
- The current DiscID implementation has some problems. Here's a better one.
- pbxx
- Why do we need an ID system at all?
- nemo
- Uh...
pbxx asks a Very Good Question. Why do we need a disc ID?
Let's start with the problem we're trying to solve.
The Problem
FreeDB is obviously trying to figure out what CD a client has in their drive, so that appropriate metadata can be returned. To this end, the FreeDB server needs to be given all the identifying information it can get.
From talks with Nemo, the only easily-obtainable distinguishing features of a CD are the track offsets and the length of the disc. That's all the information the server really needs to be given, anything more is gratuitous.
So the question is, why is encoding this information in a disc ID better (or worse!) than just sending the raw data?
Pros and Cons
Advantages of a disc ID:
- Bandwidth - It's quicker (though probably not by much) to transmit even a 64-bit ID than 99 track-offset fields and a length.
- Database ID - Any serious server implementation is going to try to use the information in the query as a database key at some point, so we might as well make a it a useful key to begin with.
Advantages of using raw data:
- Future-compatibility - If somebody comes up with a better way of hashing, you don't have to update every client to take advantage of it.
- Fewer collisions - Any hashing system has the potential to create collisions, so using the raw data will give you the fewest collisions possible.
Decision
Go not to the Elves for counsel, for they will say both no and yes.
Look at the respective advantages. Which do you think is more important? For FreeDB, I think that making the query string include all relevant details to the highest level of accuracy is probably worth it.
For NUDI, who knows? I don't know exactly what problem NUDI is trying to solve, so I can't make any reccommendations.